This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

nvim: better cmp, add none-ls & formating

+15 -21
+15 -21
tools/nvim.nix
··· 14 14 mouse = "a"; 15 15 number = true; 16 16 shiftwidth = 2; 17 + clipboard = "unnamedplus"; 17 18 # undo stuff 18 19 undofile = {}; 19 20 undolevels = 10000; ··· 33 34 lua vim.o.undodir = vim.fs.normalize('$HOME/.vim/undodir') 34 35 ''; 35 36 keymaps = [ 37 + { mode = "i"; key = "<C-p>"; action = "<Nop>"; } 38 + { mode = "i"; key = "<C-n>"; action = "<Nop>"; } 36 39 { mode = "n"; key = "<C-c>"; action = ":q<cr>"; } 37 40 { mode = "n"; key = "<Space>"; action = "<Nop>"; } 38 41 { mode = "n"; key = "<leader>u"; action = ":UndotreeToggle<cr>"; } ··· 57 60 "<leader>fp" = "yank_history"; 58 61 }; 59 62 }; 63 + plugins.lsp-format.enable = true; 60 64 plugins.lsp = { 61 65 enable = true; 62 66 servers = { ··· 64 68 nixd.enable = true; # nix 65 69 ruff-lsp.enable = true; # python 66 70 harper-ls.enable = true; # comments 71 + jsonls.enable = true; # json 67 72 }; 68 73 }; 69 74 plugins.undotree = { 70 75 enable = true; 71 76 settings.SetFocusWhenToggle = true; 72 - settings.DiffAutoOpen = true; 73 77 }; 74 78 plugins.treesitter.enable = true; 75 79 plugins.copilot-cmp.enable = true; 76 80 plugins.copilot-lua.panel.enabled = false; 77 81 plugins.copilot-lua.suggestion.enabled = false; 78 - plugins.luasnip.enable = true; 82 + plugins.cmp_yanky.enable = true; 79 83 plugins.cmp = { 80 84 enable = true; 81 85 autoEnableSources = true; 82 86 settings = { 83 - autoEnableSources = true; 84 87 experimental = { ghost_text = true; }; 85 - performance = { 86 - debounce = 60; 87 - fetchingTimeout = 200; 88 - maxViewEntries = 30; 89 - }; 90 - snippet = { expand = "luasnip"; }; 91 - formatting = { fields = [ "kind" "abbr" "menu" ]; }; 92 88 sources = [ 93 89 { name = "nvim_lsp"; } 94 90 { name = "emoji"; } 95 91 { 96 92 name = "buffer"; # text within current buffer 97 93 option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; 98 - keywordLength = 3; 94 + keywordLength = 2; 99 95 } 100 96 { 101 - name = "copilot"; # enable/disable copilot 97 + name = "copilot"; # enable copilot 102 98 } 103 99 { 104 100 name = "path"; # file system paths 105 101 keywordLength = 3; 106 102 } 107 - { 108 - name = "luasnip"; # snippets 109 - keywordLength = 3; 110 - } 103 + { name = "cmp_yanky"; } 111 104 ]; 112 - 113 - window = { 114 - completion = { border = "solid"; }; 115 - documentation = { border = "solid"; }; 116 - }; 117 105 118 106 mapping = { 119 107 "<Tab>" = "cmp.mapping.select_next_item()"; 120 108 "<S-Tab>" = "cmp.mapping.select_prev_item()"; 109 + "<C-n>" = "cmp.mapping.select_next_item()"; 110 + "<C-p>" = "cmp.mapping.select_prev_item()"; 121 111 "<C-e>" = "cmp.mapping.abort()"; 122 112 "<C-b>" = "cmp.mapping.scroll_docs(-4)"; 123 113 "<C-f>" = "cmp.mapping.scroll_docs(4)"; ··· 126 116 "<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })"; 127 117 }; 128 118 }; 119 + }; 120 + plugins.none-ls = { 121 + enable = true; 122 + sources.formatting.treefmt.enable = true; 129 123 }; 130 124 plugins.bufferline.enable = true; 131 125 plugins.which-key.enable = true;