diff options
| author | seth <[email protected]> | 2023-12-18 01:28:42 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-12-18 02:18:35 -0500 |
| commit | 8faa242f21648e52a6bbdfa803fd4ea1b0e347e0 (patch) | |
| tree | eff6694cefb2f821bf19b0d8cb3d97bf48cb15b9 /config/plugins/cmp.nix | |
| parent | 9fe8afd0c5f2b439176728d8863570bf22614dbd (diff) | |
port to nixvim
Diffstat (limited to 'config/plugins/cmp.nix')
| -rw-r--r-- | config/plugins/cmp.nix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/config/plugins/cmp.nix b/config/plugins/cmp.nix new file mode 100644 index 0000000..85c9513 --- /dev/null +++ b/config/plugins/cmp.nix @@ -0,0 +1,31 @@ +{ + plugins = { + nvim-cmp = { + enable = true; + + completion = { + completeopt = "menu,menuone,noinsert"; + }; + + mapping = { + "<C-n>" = "cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert })"; + "<C-p>" = "cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert })"; + "<C-b>" = "cmp.mapping.scroll_docs(-4)"; + "<C-f>" = "cmp.mapping.scroll_docs(4)"; + "<C-Space>" = "cmp.mapping.complete()"; + "<C-e>" = "cmp.mapping.abort()"; + "<CR>" = "cmp.mapping.confirm({ select = true })"; + "<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true})"; + }; + + snippet.expand = "luasnip"; + + sources = map (name: {inherit name;}) [ + "nvim_lsp" + "luasnip" + "async_path" + "buffer" + ]; + }; + }; +} |
