summary refs log tree commit diff
path: root/.vim/lua
diff options
context:
space:
mode:
Diffstat (limited to '.vim/lua')
-rw-r--r--.vim/lua/plugins.lua65
1 files changed, 39 insertions, 26 deletions
diff --git a/.vim/lua/plugins.lua b/.vim/lua/plugins.lua
index ddc7bbf..f586b3e 100644
--- a/.vim/lua/plugins.lua
+++ b/.vim/lua/plugins.lua
@@ -255,37 +255,50 @@ return require('packer').startup({function()
       }
     end} -- }}}
 
-  use {'hrsh7th/nvim-compe', -- {{{
-    -- requires nvim-autopairs
+  use {'hrsh7th/nvim-cmp', -- {{{
+    requires = {
+      'hrsh7th/cmp-buffer',
+      'hrsh7th/cmp-path',
+      'hrsh7th/cmp-nvim-lua',
+      'hrsh7th/cmp-nvim-lsp',
+      -- 3rd party
+      'dcampos/cmp-snippy',
+      'f3fora/cmp-spell',
+    },
     config = function()
-      require('compe').setup {
-        enabled = true,
-        autocomplete = true,
-        preselect = 'enable',
+      local cmp = require('cmp')
+      cmp.setup {
+        completion = {
+          -- autocomplete = { cmp.TriggerEvent.TextChanged }
+        },
+        preselect = cmp.PreselectMode.Item,
         documentation = {
-          border = 'single',
+          -- border = 'single',
+          border = { '', '', '', ' ', '', '', '', ' ' },
+        },
+        mapping = {
+          ['<cr>'] = cmp.mapping.confirm(),
+          ['<c-space>'] = cmp.mapping.complete(),
+          ['<c-e>'] = cmp.mapping.close(),
+        },
+        snippet = {
+          expand = function(args)
+            require('snippy').expand_snippet(args.body)
+          end,
         },
-        source = {
-          path = true,
-          buffer = true,
-          tags = true,
-          nvim_lsp = true,
-          nvim_lua = true,
-          orgmode = true,
-          ultisnips = false,
-          snippets_nvim = true,
+        sources = {
+          { name = 'nvim_lsp' },
+          { name = 'snippy' },
+          { name = 'nvim_lua' },
+          { name = 'orgmode' },
+          { name = 'spell' },
+          { name = 'path' },
+          { name = 'buffer' },
+        },
+        experimental = {
+          -- ghost_text = { hl_group = 'Comment' }
         }
       }
-
-      vim.cmd [[
-        inoremap <silent><expr> <c-space> compe#complete()
-        inoremap <silent><expr> <c-e>     compe#close('<c-e>')
-      ]]
-
-      require('nvim-autopairs.completion.compe').setup {
-        map_cr = true,
-        map_complete = true,
-      }
     end} -- }}}
 
   use {'nvim-telescope/telescope.nvim', --- {{{