From 0a1c8520faf7dc249c4c4da488beba62d42f167c Mon Sep 17 00:00:00 2001 From: albert Date: Wed, 3 Apr 2024 20:07:58 +0900 Subject: [PATCH] Update nixvim --- home-manager/common/software/cli/nixvim.nix | 24 ++----- .../common/software/cli/nixvim/base.nix | 71 +------------------ 2 files changed, 7 insertions(+), 88 deletions(-) diff --git a/home-manager/common/software/cli/nixvim.nix b/home-manager/common/software/cli/nixvim.nix index 8892ee0c..228ede11 100644 --- a/home-manager/common/software/cli/nixvim.nix +++ b/home-manager/common/software/cli/nixvim.nix @@ -11,9 +11,7 @@ } ) - vim.diagnostic.config { - float = { border = _border } - } + vim.diagnostic.config { float = { border = _border } } require('lspconfig.ui.windows').default_options = { border = _border } local signs = { Error = "󰅚 ", Warn = "󰀪 ", Hint = "󰌶 ", Info = " " } @@ -34,8 +32,8 @@ ''; plugins = { - lsp-lines.enable = false; - lsp-lines.currentLine = true; + lsp-lines.enable = true; + lsp-lines.currentLine = false; crates-nvim.enable = true; lspsaga = { enable = false; @@ -78,20 +76,6 @@ }; onAttach = '' - vim.api.nvim_create_autocmd("CursorHold", { - buffer = bufnr, - callback = function() - local opts = { - focusable = false, - close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, - border = 'rounded', - source = 'always', - prefix = ' ', - scope = 'cursor', - } - vim.diagnostic.open_float(nil, opts) - end - }) vim.lsp.handlers["textDocument/hover"] = vim.lsp.with ( vim.lsp.handlers.hover, { border = "rounded", @@ -99,7 +83,7 @@ ) ''; keymaps = { - silent = false; + silent = true; diagnostic = { "lk" = { action = "goto_prev"; diff --git a/home-manager/common/software/cli/nixvim/base.nix b/home-manager/common/software/cli/nixvim/base.nix index 934089c7..fba1d599 100644 --- a/home-manager/common/software/cli/nixvim/base.nix +++ b/home-manager/common/software/cli/nixvim/base.nix @@ -2,6 +2,7 @@ imports = [ ./alpha.nix ./keymaps.nix + ./cmp.nix inputs.nixvim.homeManagerModules.nixvim ] ++ lib.optional (builtins.isString theme) ../../../../../stylix/themes/${theme}/home-manager/nixvim.nix; @@ -47,7 +48,7 @@ # Fancy popups, etc for vim noice = { enable = true; - popupmenu.enabled = true; + popupmenu.enabled = false; lsp.hover.enabled = false; }; notify = { @@ -126,16 +127,6 @@ # Code Related # Parser generator tool treesitter.enable = true; - # Snippet engine for neovim - luasnip.enable = true; - cmp_luasnip.enable = true; - # CMP Addons - cmp-buffer.enable = true; - cmp-path.enable = true; - cmp-nvim-lsp.enable = true; - cmp-nvim-lsp-document-symbol.enable = true; - cmp-nvim-lsp-signature-help.enable = true; - # List of linters for nixvim lint = { @@ -230,63 +221,7 @@ }; }; }; - - nvim-cmp = { - enable = true; - autoEnableSources = true; - mapping = { - "" = "cmp.mapping.complete()"; - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.close()"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.confirm({ select = true })"; - "" = { - action = "cmp.mapping.select_prev_item()"; - modes = [ - "i" - "s" - ]; - }; - "" = { - action = "cmp.mapping.select_next_item()"; - modes = [ - "i" - "s" - ]; - }; - }; - sources = [ -# { name = "nvim_lua"; } - { name = "nvim_lsp"; } - { name = "nvim_lsp_signature_help"; } - { name = "calc"; } - { name = "path"; } - { name = "buffer"; } - { name = "luasnip"; } - ]; - snippet.expand = "luasnip"; - window = { - completion.border = "rounded"; - documentation.border = "rounded"; - }; - formatting = { - fields = [ "menu" "abbr" "kind" ]; - # https://rsdlt.github.io/posts/rust-nvim-ide-guide-walkthrough-development-debug/ - format = '' - function(entry, item) - local menu_icon = { - nvim_lsp = 'λ', - luasnip = '⋗', - buffer = 'Ω', - path = '🖫', - } - item.menu = menu_icon[entry.source.name] - return item - end, - ''; - }; - }; - }; + }; colorschemes = { tokyonight.enable = true;