feat(neovim): replace lightline with lualine.nvim
This commit is contained in:
parent
2f159358e3
commit
3133316f6e
|
@ -18,7 +18,7 @@ in {
|
||||||
editorconfig-nvim
|
editorconfig-nvim
|
||||||
direnv-vim
|
direnv-vim
|
||||||
fzf-vim
|
fzf-vim
|
||||||
lightline-vim
|
lualine-nvim
|
||||||
nvim-tree-lua
|
nvim-tree-lua
|
||||||
toggleterm-nvim
|
toggleterm-nvim
|
||||||
vim-startify
|
vim-startify
|
||||||
|
@ -60,7 +60,7 @@ in {
|
||||||
vimLua (lib.foldl (r: f: r + "\n" + readFile f) "" [
|
vimLua (lib.foldl (r: f: r + "\n" + readFile f) "" [
|
||||||
./init.lua
|
./init.lua
|
||||||
./startify.lua
|
./startify.lua
|
||||||
./lightline.lua
|
./lualine.lua
|
||||||
./which-key.lua
|
./which-key.lua
|
||||||
./gitsigns.lua
|
./gitsigns.lua
|
||||||
./test.lua
|
./test.lua
|
||||||
|
|
|
@ -1,54 +0,0 @@
|
||||||
function LspStatus()
|
|
||||||
local sl = ""
|
|
||||||
if not vim.tbl_isempty(vim.lsp.buf_get_clients(0)) then
|
|
||||||
local errors = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })
|
|
||||||
local warnings = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN })
|
|
||||||
local infos = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO })
|
|
||||||
local hints = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT })
|
|
||||||
if (errors > 0 or warnings > 0 or infos > 0 or hints > 0) then
|
|
||||||
if errors > 0 then
|
|
||||||
sl = sl .. " " .. errors
|
|
||||||
end
|
|
||||||
if warnings > 0 then
|
|
||||||
sl = sl .. " " .. warnings
|
|
||||||
end
|
|
||||||
if infos > 0 then
|
|
||||||
sl = sl .. " " .. infos
|
|
||||||
end
|
|
||||||
if hints > 0 then
|
|
||||||
sl = sl .. " " .. hints
|
|
||||||
end
|
|
||||||
else
|
|
||||||
sl = sl .. ""
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return sl
|
|
||||||
end
|
|
||||||
|
|
||||||
function GitStatus()
|
|
||||||
local status = vim.b.gitsigns_status
|
|
||||||
return status ~= nil and status or ""
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.g.lightline = {
|
|
||||||
colorscheme = "powerline",
|
|
||||||
active = {
|
|
||||||
left = {
|
|
||||||
{ "mode", "paste" },
|
|
||||||
{ "lspstatus", "readonly", "filename", "gitstatus", "modified" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
component_expand = {
|
|
||||||
lspstatus = "{ -> luaeval('LspStatus()')}",
|
|
||||||
gitstatus = "{ -> luaeval('GitStatus()')}",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- update on lsp status changes
|
|
||||||
vim.cmd([[
|
|
||||||
augroup lightline_diagnostics
|
|
||||||
autocmd!
|
|
||||||
autocmd User LspProgressUpdate call lightline#update()
|
|
||||||
autocmd DiagnosticChanged * call lightline#update()
|
|
||||||
augroup END
|
|
||||||
]])
|
|
6
home/editors/neovim/lualine.lua
Normal file
6
home/editors/neovim/lualine.lua
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
require("lualine").setup {
|
||||||
|
options = {
|
||||||
|
component_separators = { left = "", right = ""},
|
||||||
|
section_separators = { left = "", right = ""},
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in a new issue