From 0e7cf5007b5171f86f5f4608a8af5dc15406309f Mon Sep 17 00:00:00 2001 From: albert Date: Wed, 3 Apr 2024 16:27:54 +0900 Subject: [PATCH] Update nixvim --- home-manager/common/software/cli/nixvim.nix | 39 +++++++------------ .../common/software/cli/nixvim/base.nix | 7 ++++ 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/home-manager/common/software/cli/nixvim.nix b/home-manager/common/software/cli/nixvim.nix index 57c05d60..8892ee0c 100644 --- a/home-manager/common/software/cli/nixvim.nix +++ b/home-manager/common/software/cli/nixvim.nix @@ -5,29 +5,18 @@ extraConfigLuaPost = '' local _border = "rounded" - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( - vim.lsp.handlers.hover, { - border = _border - } - ) - - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with ( vim.lsp.handlers.signature_help, { border = _border } ) - vim.diagnostic.config{ - float={border=_border} + vim.diagnostic.config { + float = { border = _border } } - vim.cmd [[nnoremap :lua vim.lsp.diagnostic.show_line_diagnostics({ border = "single" })]] - vim.cmd [[nnoremap ]g :lua vim.lsp.diagnostic.goto_next({ popup_opts = { border = "single" }})]] - vim.cmd [[nnoremap [g :lua vim.lsp.diagnostic.goto_prev({ popup_opts = { border = "single" }})]] - vim.diagnostic.config { float={border=_border} } require('lspconfig.ui.windows').default_options = { border = _border } local signs = { Error = "󰅚 ", Warn = "󰀪 ", Hint = "󰌶 ", Info = " " } - for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) @@ -40,22 +29,19 @@ return orig_util_open_floating_preview(contents, syntax, opts, ...) end - vim.diagnostic.config({ - virtual_text = { - prefix = '●', - } - }) - LspDiagnosticsFloatingError = {fg=color1,bg=none,style='bold'}; - LspDiagnosticsFloatingWarning = {fg=color2,bg=none,style='bold'}; - LspDiagnosticsFloatingInformation = {fg=color3,bg=none,style='italic'}; - LspDiagnosticsFloatingHint = {fg=color4,bg=none,style='italic'}; - + vim.diagnostic.config ( { virtual_text = { prefix = '●', } } ) + vim.diagnostic.config { float = { border = _border } } ''; plugins = { lsp-lines.enable = false; lsp-lines.currentLine = true; crates-nvim.enable = true; + lspsaga = { + enable = false; + lightbulb.enable = false; + ui.border = "rounded"; + }; lsp = { enable = true; servers = { @@ -106,6 +92,11 @@ vim.diagnostic.open_float(nil, opts) end }) + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with ( + vim.lsp.handlers.hover, { + border = "rounded", + } + ) ''; keymaps = { silent = false; diff --git a/home-manager/common/software/cli/nixvim/base.nix b/home-manager/common/software/cli/nixvim/base.nix index 783c8414..934089c7 100644 --- a/home-manager/common/software/cli/nixvim/base.nix +++ b/home-manager/common/software/cli/nixvim/base.nix @@ -37,6 +37,9 @@ fugitive.enable = true; # pretty stuff + # Fancify markdown et al + # TODO Re-enable this after 24.05 + # headlines.enable = true; # Rainbow matching {} [] () 's rainbow-delimiters.enable = true; # Colorize hex colors inline @@ -45,6 +48,7 @@ noice = { enable = true; popupmenu.enabled = true; + lsp.hover.enabled = false; }; notify = { enable = true; @@ -80,6 +84,8 @@ # tab bar like Firefox or Chrome bufferline = { enable = true; + hover.enabled = true; + separatorStyle = "slant"; offsets = [{ filetype = "NvimTree"; text = "File Explorer"; @@ -93,6 +99,7 @@ nvim-tree = { enable = true; diagnostics.enable = true; + tab.sync.close = true; renderer = { highlightModified = "icon"; highlightOpenedFiles = "all";