From 3133316f6e61ebc661e58f48f1b9aa7d469b637b Mon Sep 17 00:00:00 2001 From: Felix Tenley Date: Wed, 30 Mar 2022 02:13:42 +0200 Subject: [PATCH] feat(neovim): replace lightline with lualine.nvim --- home/editors/neovim/default.nix | 4 +-- home/editors/neovim/lightline.lua | 54 ------------------------------- home/editors/neovim/lualine.lua | 6 ++++ 3 files changed, 8 insertions(+), 56 deletions(-) delete mode 100644 home/editors/neovim/lightline.lua create mode 100644 home/editors/neovim/lualine.lua diff --git a/home/editors/neovim/default.nix b/home/editors/neovim/default.nix index f434085..e962a2e 100644 --- a/home/editors/neovim/default.nix +++ b/home/editors/neovim/default.nix @@ -18,7 +18,7 @@ in { editorconfig-nvim direnv-vim fzf-vim - lightline-vim + lualine-nvim nvim-tree-lua toggleterm-nvim vim-startify @@ -60,7 +60,7 @@ in { vimLua (lib.foldl (r: f: r + "\n" + readFile f) "" [ ./init.lua ./startify.lua - ./lightline.lua + ./lualine.lua ./which-key.lua ./gitsigns.lua ./test.lua diff --git a/home/editors/neovim/lightline.lua b/home/editors/neovim/lightline.lua deleted file mode 100644 index 868edb4..0000000 --- a/home/editors/neovim/lightline.lua +++ /dev/null @@ -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 -]]) diff --git a/home/editors/neovim/lualine.lua b/home/editors/neovim/lualine.lua new file mode 100644 index 0000000..8c778b0 --- /dev/null +++ b/home/editors/neovim/lualine.lua @@ -0,0 +1,6 @@ +require("lualine").setup { + options = { + component_separators = { left = "", right = ""}, + section_separators = { left = "", right = ""}, + }, +}