feat: lightline theme (#39)

This commit is contained in:
Santos Gallegos
2021-05-17 01:44:17 -05:00
committed by GitHub
parent 1e7f849d17
commit 5eb534d77e
3 changed files with 55 additions and 1 deletions

View File

@@ -39,13 +39,14 @@ A dark and light Neovim theme written in Lua ported from the Visual Studio Code
+ [Dashboard](https://github.com/glepnir/dashboard-nvim)
+ [BufferLine](https://github.com/akinsho/nvim-bufferline.lua)
+ [Lualine](https://github.com/hoob3rt/lualine.nvim)
+ [Lightline](https://github.com/itchyny/lightline.vim)
+ [Neogit](https://github.com/TimUntersberger/neogit)
+ [vim-sneak](https://github.com/justinmk/vim-sneak)
## ⚡️ Requirements
+ Neovim >= 0.5.0
## 📦 Installation
Install the theme with your preferred package manager:
@@ -88,6 +89,13 @@ require('lualine').setup {
}
```
To enable the `tokyonight` colorscheme for `Lightline`:
```vim
" Vim Script
let g:lightline = {'colorscheme': 'tokyonight'}
```
## ⚙️ Configuration
> ❗️ configuration needs to be set **BEFORE** loading the color scheme with `colorscheme tokyonight`

View File

@@ -0,0 +1,2 @@
let s:palette = v:lua.require('lightline.colorscheme.tokyonight')
let g:lightline#colorscheme#tokyonight#palette = lightline#colorscheme#fill(s:palette)

View File

@@ -0,0 +1,44 @@
local config = require("tokyonight.config")
local colors = require("tokyonight.colors").setup(config)
local util = require("tokyonight.util")
local tokyonight = {}
tokyonight.normal = {
left = {{ colors.black, colors.blue }, { colors.blue, colors.bg }},
middle = {{ colors.blue, colors.fg_gutter }},
right = {{ colors.fg_sidebar, colors.bg_statusline }, { colors.blue, colors.bg }},
error = {{ colors.black, colors.error }},
warning = {{ colors.black, colors.warning }},
}
tokyonight.insert = {
left = {{ colors.black, colors.green }, { colors.blue, colors.bg }},
}
tokyonight.visual = {
left = {{ colors.black, colors.magenta }, { colors.blue, colors.bg }},
}
tokyonight.replace = {
left = {{ colors.black, colors.red }, { colors.blue, colors.bg }},
}
tokyonight.inactive = {
left = {{ colors.blue, colors.bg_statusline }, {colors.dark3, colors.bg }},
middle = {{ colors.fg_gutter, colors.bg_statusline }},
right = {{ colors.fg_gutter, colors.bg_statusline }, {colors.dark3, colors.bg }},
}
if vim.o.background == "light" then
for _, mode in pairs(tokyonight) do
for _, section in pairs(mode) do
for _, subsection in pairs(section) do
subsection[1] = util.getColor(subsection[1])
subsection[2] = util.getColor(subsection[2])
end
end
end
end
return tokyonight