Add nvim_cmp
This commit is contained in:
parent
b342c1154a
commit
87225d7257
32
lua/config/nvim_cmp.lua
Normal file
32
lua/config/nvim_cmp.lua
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
local cmp = require('cmp')
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = function(args)
|
||||||
|
vim.fn["vsnip#anonymous"](args.body)
|
||||||
|
end,
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<C-Down>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-Up>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'vsnip' },
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
local servers = require('lspconfig')
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
for _, server in ipairs(servers) do
|
||||||
|
require('lspconfig')[server].setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
end
|
|
@ -75,6 +75,11 @@ local function init()
|
||||||
use {'ms-jpq/coq_nvim', branch = 'coq'}
|
use {'ms-jpq/coq_nvim', branch = 'coq'}
|
||||||
use {'ms-jpq/coq.artifacts', branch = 'artifacts'}
|
use {'ms-jpq/coq.artifacts', branch = 'artifacts'}
|
||||||
use {'ms-jpq/coq.thirdparty', branch = '3p'}
|
use {'ms-jpq/coq.thirdparty', branch = '3p'}
|
||||||
|
-- -- nvim-cmp
|
||||||
|
use 'hrsh7th/cmp-nvim-lsp'
|
||||||
|
use 'hrsh7th/nvim-cmp'
|
||||||
|
use 'hrsh7th/cmp-vsnip'
|
||||||
|
use 'hrsh7th/vim-vsnip'
|
||||||
|
|
||||||
-- Split maximizer
|
-- Split maximizer
|
||||||
use 'szw/vim-maximizer'
|
use 'szw/vim-maximizer'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user