From f9765b9a21fc14d7618c39ef11d6e31c50d88cde Mon Sep 17 00:00:00 2001 From: meml0rz Date: Wed, 13 Nov 2024 00:31:19 +0100 Subject: [PATCH] kekl --- modules/nix/nvim/cmp.nix | 193 ++++++++++++++++++++------------------- 1 file changed, 97 insertions(+), 96 deletions(-) diff --git a/modules/nix/nvim/cmp.nix b/modules/nix/nvim/cmp.nix index ca0e8a7..7079d7a 100644 --- a/modules/nix/nvim/cmp.nix +++ b/modules/nix/nvim/cmp.nix @@ -16,110 +16,111 @@ let in { programs.nixvim.plugins = { - cmp = { - enable = true; - autoEnableSources = true; + cmp = { + enable = true; + autoEnableSources = true; - settings = { - mapping = { - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.complete()"; - "" = "cmp.mapping.close()"; - "" = "cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})"; - "" = "cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})"; - "" = "cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace })"; - }; - - preselect = "cmp.PreselectMode.None"; - - snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; - - sources = [ - { - name = "nvim_lsp"; - priority = 1000; - option = { - inherit get_bufnrs; - }; - } - { - name = "nvim_lsp_signature_help"; - priority = 1000; - option = { - inherit get_bufnrs; - }; - } - { - name = "nvim_lsp_document_symbol"; - priority = 1000; - option = { - inherit get_bufnrs; - }; - } - { - name = "treesitter"; - priority = 850; - option = { - inherit get_bufnrs; + settings = { + mapping = { + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.close()"; + "" = "cmp.mapping(cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})"; + "" = "cmp.mapping(cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select}), {'i', 's'})"; + "" = "cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace })"; }; - } - { - name = "luasnip"; - priority = 750; - } - { - name = "buffer"; - priority = 500; + + preselect = "cmp.PreselectMode.None"; + + snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + + sources = [ + { + name = "nvim_lsp"; + priority = 1000; + option = { + inherit get_bufnrs; + }; + } + { + name = "nvim_lsp_signature_help"; + priority = 1000; + option = { + inherit get_bufnrs; + }; + } + { + name = "nvim_lsp_document_symbol"; + priority = 1000; + option = { + inherit get_bufnrs; + }; + } + { + name = "treesitter"; + priority = 850; option = { - inherit get_bufnrs; + inherit get_bufnrs; }; - } - { - name = "path"; - priority = 300; - } - { - name = "cmdline"; - priority = 300; - } - { - name = "git"; - priority = 250; - } - { - name = "calc"; - priority = 150; - } - { - name = "emoji"; - priority = 100; - } - ]; + } + { + name = "luasnip"; + priority = 750; + } + { + name = "buffer"; + priority = 500; + option = { + inherit get_bufnrs; + }; + } + { + name = "path"; + priority = 300; + } + { + name = "cmdline"; + priority = 300; + } + { + name = "git"; + priority = 250; + } + { + name = "calc"; + priority = 150; + } + { + name = "emoji"; + priority = 100; + } + ]; + }; }; - }; - friendly-snippets.enable = true; - luasnip.enable = true; + friendly-snippets.enable = true; + luasnip.enable = true; - lspkind = { - enable = true; - cmp = { + lspkind = { enable = true; - menu = { - buffer = ""; - calc = ""; - cmdline = ""; - codeium = "󱜙"; - emoji = "󰞅"; - git = ""; - luasnip = "󰩫"; - neorg = ""; - nvim_lsp = ""; - nvim_lua = ""; - path = ""; - spell = ""; - treesitter = "󰔱"; + cmp = { + enable = true; + menu = { + buffer = ""; + calc = ""; + cmdline = ""; + codeium = "󱜙"; + emoji = "󰞅"; + git = ""; + luasnip = "󰩫"; + neorg = ""; + nvim_lsp = ""; + nvim_lua = ""; + path = ""; + spell = ""; + treesitter = "󰔱"; + }; }; }; };