summaryrefslogtreecommitdiffstats
path: root/common/nixvim.nix
diff options
context:
space:
mode:
Diffstat (limited to 'common/nixvim.nix')
-rw-r--r--common/nixvim.nix57
1 files changed, 3 insertions, 54 deletions
diff --git a/common/nixvim.nix b/common/nixvim.nix
index abcd4d6..0092744 100644
--- a/common/nixvim.nix
+++ b/common/nixvim.nix
@@ -351,64 +351,13 @@ inputs:
351 ]; 351 ];
352 352
353 plugins = { 353 plugins = {
354 cmp = { 354 blink-cmp = {
355 enable = true; 355 enable = true;
356
357 settings = { 356 settings = {
358 mapping.__raw = '' 357 keymap.preset = "enter";
359 cmp.mapping.preset.insert { 358 completion.documentation.auto_show = true;
360 ['<CR>'] = cmp.mapping.confirm({ select = false }),
361
362 ["<Tab>"] = cmp.mapping(function(fallback)
363 local luasnip = require("luasnip")
364 if luasnip.locally_jumpable(1) then
365 luasnip.jump(1)
366 else
367 fallback()
368 end
369 end, { "i", "s" }),
370
371 ["<S-Tab>"] = cmp.mapping(function(fallback)
372 local luasnip = require("luasnip")
373 if luasnip.locally_jumpable(-1) then
374 luasnip.jump(-1)
375 else
376 fallback()
377 end
378 end, { "i", "s" }),
379 }
380 '';
381
382 snippet.expand = ''
383 function(args)
384 require('luasnip').lsp_expand(args.body)
385 end
386 '';
387
388 sources = [
389 { name = "nvim_lsp"; }
390 { name = "cmp_pandoc"; }
391 # TODO: make this modular
392 { name = "crates"; }
393 { name = "luasnip"; }
394 { name = "calc"; }
395 { name = "path"; }
396 { name = "treesitter"; }
397 { name = "git"; }
398 { name = "tmux"; }
399 { name = "spell"; }
400 # Use \k for iskeyword because of UTF-8
401 {
402 name = "buffer";
403 option.keyword_pattern = ''\k\+'';
404 }
405 ];
406 }; 359 };
407 }; 360 };
408 # cmp-buffer.enable = true;
409 # cmp-calc.enable = true;
410 # cmp-cmdline.enable = true;
411 # cmp-git.enable = true;
412 361
413 diffview.enable = true; 362 diffview.enable = true;
414 363