aboutsummaryrefslogtreecommitdiff
path: root/cmp.vim
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2021-12-06 14:15:59 +0000
committerJuan J. Martinez <jjm@usebox.net>2022-05-29 22:57:30 +0100
commit98fa2f083062c4f85b0b2f2057b30e76e9b8e309 (patch)
tree8bd53941c7d03f9682812e4d151f02617b464ac3 /cmp.vim
parent783154e2c1b45238f53527fc02d6ea5a670b7c7f (diff)
downloaddotnvim-98fa2f083062c4f85b0b2f2057b30e76e9b8e309.tar.gz
dotnvim-98fa2f083062c4f85b0b2f2057b30e76e9b8e309.zip
Use CMP
Diffstat (limited to 'cmp.vim')
-rw-r--r--cmp.vim36
1 files changed, 36 insertions, 0 deletions
diff --git a/cmp.vim b/cmp.vim
new file mode 100644
index 0000000..e720e65
--- /dev/null
+++ b/cmp.vim
@@ -0,0 +1,36 @@
+lua <<EOF
+ -- Setup nvim-cmp.
+ local cmp = require'cmp'
+
+ cmp.setup({
+ snippet = {
+ expand = function(args)
+ vim.fn["vsnip#anonymous"](args.body)
+ end,
+ },
+ mapping = {
+ ['<CR>'] = cmp.mapping.confirm({ select = true }),
+ },
+ sources = cmp.config.sources({
+ { name = 'nvim_lsp' },
+ { name = 'vsnip' },
+ })
+ })
+
+ -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
+ cmp.setup.cmdline('/', {
+ sources = {
+ { name = 'buffer' }
+ }
+ })
+
+ -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
+ cmp.setup.cmdline(':', {
+ sources = cmp.config.sources({
+ { name = 'path' }
+ }, {
+ { name = 'cmdline' }
+ })
+ })
+EOF
+