diff options
author | Minijackson <minijackson@riseup.net> | 2022-04-12 12:48:25 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2022-04-12 12:48:25 +0200 |
commit | 0aac4d5de31a5c64f6f10c8e192e83054fac5267 (patch) | |
tree | cea2f20af5bc5c59fd98332e1a6ed816d2be7f76 /dotfiles | |
parent | 621fb6648b063ebadb54d0267bd40e039d186a32 (diff) | |
download | nixos-config-reborn-0aac4d5de31a5c64f6f10c8e192e83054fac5267.tar.gz nixos-config-reborn-0aac4d5de31a5c64f6f10c8e192e83054fac5267.zip |
vim: switch deprecated nvim-compe -> nvim-cmp
Diffstat (limited to 'dotfiles')
-rw-r--r-- | dotfiles/vim-dev.lua | 1 | ||||
-rw-r--r-- | dotfiles/vim.lua | 52 |
2 files changed, 37 insertions, 16 deletions
diff --git a/dotfiles/vim-dev.lua b/dotfiles/vim-dev.lua index 55ac142..ab04bf8 100644 --- a/dotfiles/vim-dev.lua +++ b/dotfiles/vim-dev.lua | |||
@@ -64,6 +64,7 @@ capabilities.textDocument.completion.completionItem.resolveSupport = { | |||
64 | 'additionalTextEdits', | 64 | 'additionalTextEdits', |
65 | } | 65 | } |
66 | } | 66 | } |
67 | capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) | ||
67 | 68 | ||
68 | require("rust-tools").setup { | 69 | require("rust-tools").setup { |
69 | server = { | 70 | server = { |
diff --git a/dotfiles/vim.lua b/dotfiles/vim.lua index 9317453..0e89ba6 100644 --- a/dotfiles/vim.lua +++ b/dotfiles/vim.lua | |||
@@ -166,26 +166,46 @@ require('nvim-treesitter.configs').setup { | |||
166 | vim.o.foldmethod = 'expr' | 166 | vim.o.foldmethod = 'expr' |
167 | vim.o.foldexpr = 'nvim_treesitter#foldexpr()' | 167 | vim.o.foldexpr = 'nvim_treesitter#foldexpr()' |
168 | 168 | ||
169 | -- nvim-compe | 169 | -- nvim-cmp |
170 | 170 | ||
171 | require("compe").setup { | 171 | local cmp = require("cmp") |
172 | source = { | 172 | |
173 | buffer = true, | 173 | cmp.setup { |
174 | calc = true, | 174 | snippet = { |
175 | latex_symbols = true, | 175 | expand = function(args) |
176 | nvim_lsp = true, | 176 | vim.fn["vsnip#anonymous"](args.body) |
177 | nvim_lua = true, | 177 | end, |
178 | nvim_treesitter = true, | 178 | }, |
179 | omni = false, | 179 | mapping = { |
180 | path = true, | 180 | ['<CR>'] = cmp.mapping.confirm({ select = false }), |
181 | spell = true, | ||
182 | vsnip = true, | ||
183 | zsh = true, | ||
184 | }, | 181 | }, |
182 | sources = cmp.config.sources({ | ||
183 | { name = "nvim_lsp" }, | ||
184 | { name = "vsnip" }, | ||
185 | { name = "latex_symbols" }, | ||
186 | { name = "calc" }, | ||
187 | }, { | ||
188 | { name = "path" }, | ||
189 | { name = "treesitter" }, | ||
190 | }, { | ||
191 | { name = "tmux" }, | ||
192 | { name = "spell" }, | ||
193 | -- Use \k for iskeyword because of UTF-8 | ||
194 | { name = "buffer", option = { keyword_pattern = [[\k\+]], } }, | ||
195 | }), | ||
185 | } | 196 | } |
186 | 197 | ||
187 | map("i", "<CR>", "compe#confirm('<CR>')", { noremap = true, silent = true, expr = true }) | 198 | cmp.setup.cmdline("/", { |
188 | map("i", "<C-e>", "compe#close('<C-e>')", { noremap = true, silent = true, expr = true }) | 199 | sources = { |
200 | { name = "buffer", option = { keyword_pattern = [[\k\+]], } }, | ||
201 | } | ||
202 | }) | ||
203 | |||
204 | cmp.setup.cmdline(":", { | ||
205 | sources = cmp.config.sources({ | ||
206 | { name = "cmdline" }, | ||
207 | }) | ||
208 | }) | ||
189 | 209 | ||
190 | -- Telescope | 210 | -- Telescope |
191 | 211 | ||