completion-nvim -> nvim-cmp | ultisnips -> luasnip
This commit is contained in:
parent
7df892ce8e
commit
f2d793817b
13 changed files with 63 additions and 27 deletions
33
.gitmodules
vendored
33
.gitmodules
vendored
|
|
@ -1,12 +1,6 @@
|
||||||
[submodule "pack/general/start/ale"]
|
[submodule "pack/general/start/ale"]
|
||||||
path = pack/general/start/ale
|
path = pack/general/start/ale
|
||||||
url = https://github.com/dense-analysis/ale
|
url = https://github.com/dense-analysis/ale
|
||||||
[submodule "pack/general/start/completion-buffers"]
|
|
||||||
path = pack/general/start/completion-buffers
|
|
||||||
url = https://github.com/steelsojka/completion-buffers
|
|
||||||
[submodule "pack/general/start/completion-nvim"]
|
|
||||||
path = pack/general/start/completion-nvim
|
|
||||||
url = https://github.com/nvim-lua/completion-nvim
|
|
||||||
[submodule "pack/general/start/gruvbox.nvim"]
|
[submodule "pack/general/start/gruvbox.nvim"]
|
||||||
path = pack/general/start/gruvbox.nvim
|
path = pack/general/start/gruvbox.nvim
|
||||||
url = https://github.com/npxbr/gruvbox.nvim
|
url = https://github.com/npxbr/gruvbox.nvim
|
||||||
|
|
@ -28,9 +22,6 @@
|
||||||
[submodule "pack/general/start/telescope.nvim"]
|
[submodule "pack/general/start/telescope.nvim"]
|
||||||
path = pack/general/start/telescope.nvim
|
path = pack/general/start/telescope.nvim
|
||||||
url = https://github.com/nvim-telescope/telescope.nvim
|
url = https://github.com/nvim-telescope/telescope.nvim
|
||||||
[submodule "pack/general/start/ultisnips"]
|
|
||||||
path = pack/general/start/ultisnips
|
|
||||||
url = https://github.com/SirVer/ultisnips
|
|
||||||
[submodule "pack/general/start/vim-airline"]
|
[submodule "pack/general/start/vim-airline"]
|
||||||
path = pack/general/start/vim-airline
|
path = pack/general/start/vim-airline
|
||||||
url = https://github.com/vim-airline/vim-airline
|
url = https://github.com/vim-airline/vim-airline
|
||||||
|
|
@ -40,9 +31,6 @@
|
||||||
[submodule "pack/general/start/vim-markdown"]
|
[submodule "pack/general/start/vim-markdown"]
|
||||||
path = pack/general/start/vim-markdown
|
path = pack/general/start/vim-markdown
|
||||||
url = https://github.com/plasticboy/vim-markdown
|
url = https://github.com/plasticboy/vim-markdown
|
||||||
[submodule "pack/general/start/vim-snippets"]
|
|
||||||
path = pack/general/start/vim-snippets
|
|
||||||
url = https://github.com/honza/vim-snippets
|
|
||||||
[submodule "pack/general/start/vim-surround"]
|
[submodule "pack/general/start/vim-surround"]
|
||||||
path = pack/general/start/vim-surround
|
path = pack/general/start/vim-surround
|
||||||
url = https://github.com/tpope/vim-surround
|
url = https://github.com/tpope/vim-surround
|
||||||
|
|
@ -58,3 +46,24 @@
|
||||||
[submodule "pack/general/start/gitsigns.nvim"]
|
[submodule "pack/general/start/gitsigns.nvim"]
|
||||||
path = pack/general/start/gitsigns.nvim
|
path = pack/general/start/gitsigns.nvim
|
||||||
url = https://github.com/lewis6991/gitsigns.nvim
|
url = https://github.com/lewis6991/gitsigns.nvim
|
||||||
|
[submodule "pack/general/start/nvim-cmp"]
|
||||||
|
path = pack/general/start/nvim-cmp
|
||||||
|
url = https://github.com/hrsh7th/nvim-cmp
|
||||||
|
[submodule "pack/general/start/cmp-path"]
|
||||||
|
path = pack/general/start/cmp-path
|
||||||
|
url = https://github.com/hrsh7th/cmp-path
|
||||||
|
[submodule "pack/general/start/LuaSnip"]
|
||||||
|
path = pack/general/start/LuaSnip
|
||||||
|
url = https://github.com/L3MON4D3/LuaSnip
|
||||||
|
[submodule "pack/general/start/cmd_luasnip"]
|
||||||
|
path = pack/general/start/cmp_luasnip
|
||||||
|
url = https://github.com/saadparwaiz1/cmp_luasnip
|
||||||
|
[submodule "pack/general/start/cmp-buffer"]
|
||||||
|
path = pack/general/start/cmp-buffer
|
||||||
|
url = https://github.com/hrsh7th/cmp-buffer
|
||||||
|
[submodule "pack/general/start/cmp-nvim-lsp"]
|
||||||
|
path = pack/general/start/cmp-nvim-lsp
|
||||||
|
url = https://github.com/hrsh7th/cmp-nvim-lsp
|
||||||
|
[submodule "pack/general/start/friendly-snippets"]
|
||||||
|
path = pack/general/start/friendly-snippets
|
||||||
|
url = https://github.com/rafamadriz/friendly-snippets
|
||||||
|
|
|
||||||
46
init.lua
46
init.lua
|
|
@ -162,19 +162,43 @@ map('n', '[w', '<Plug>(ale_previous_wrap)')
|
||||||
map('n', ']w', '<Plug>(ale_next_wrap)')
|
map('n', ']w', '<Plug>(ale_next_wrap)')
|
||||||
map('n', ']W', '<Plug>(ale_last)')
|
map('n', ']W', '<Plug>(ale_last)')
|
||||||
---- completion-nvim
|
---- completion-nvim
|
||||||
-- Use completion-nvim in every buffer
|
local cmp = require'cmp'
|
||||||
g.completion_enable_snippet = 'UltiSnips'
|
|
||||||
opt.completeopt = {'menuone', 'noinsert', 'noselect'}
|
cmp.setup({
|
||||||
g.completion_chain_complete_list = {
|
snippet = {
|
||||||
default = {
|
expand = function(args)
|
||||||
{ complete_items = { 'lsp', 'snippet', 'buffer' } },
|
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||||
{ mode = { '<c-p>' } },
|
end,
|
||||||
{ mode = { '<c-n>' } }
|
|
||||||
},
|
},
|
||||||
}
|
window = {
|
||||||
cmd [[autocmd FileType *\(TelescopePrompt\)\@<! lua require'completion'.on_attach()]]
|
-- completion = cmp.config.window.bordered(),
|
||||||
|
-- documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.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(),
|
||||||
|
-- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'luasnip' },
|
||||||
|
{ name = 'path' },
|
||||||
|
{ name = 'buffer' },
|
||||||
|
})
|
||||||
|
})
|
||||||
|
--cmd [[autocmd FileType *\(TelescopePrompt\)\@<! lua require'completion'.on_attach()]]
|
||||||
|
-- Setup lspconfig.
|
||||||
|
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
|
for _, server in ipairs(servers) do
|
||||||
|
require('lspconfig')[server].setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
end
|
||||||
---- Ultisnips
|
---- Ultisnips
|
||||||
g.UltiSnipsSnippetDirectories = {'UltiSnips', 'mysnippets'}
|
--g.UltiSnipsSnippetDirectories = {'UltiSnips', 'mysnippets'}
|
||||||
---- gitsigns.nvim
|
---- gitsigns.nvim
|
||||||
require('gitsigns').setup {
|
require('gitsigns').setup {
|
||||||
on_attach = function(bufnr)
|
on_attach = function(bufnr)
|
||||||
|
|
|
||||||
1
pack/general/start/LuaSnip
Submodule
1
pack/general/start/LuaSnip
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit a12441e0598e93e67235eba67c8e6fbffc896f06
|
||||||
1
pack/general/start/cmp-buffer
Submodule
1
pack/general/start/cmp-buffer
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 62fc67a2b0205136bc3e312664624ba2ab4a9323
|
||||||
1
pack/general/start/cmp-nvim-lsp
Submodule
1
pack/general/start/cmp-nvim-lsp
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit affe808a5c56b71630f17aa7c38e15c59fd648a8
|
||||||
1
pack/general/start/cmp-path
Submodule
1
pack/general/start/cmp-path
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 466b6b8270f7ba89abd59f402c73f63c7331ff6e
|
||||||
1
pack/general/start/cmp_luasnip
Submodule
1
pack/general/start/cmp_luasnip
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit a9de941bcbda508d0a45d28ae366bb3f08db2e36
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit c36871b2a44b59761387f4972c617b44dcec5e75
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 87b0f86da3dffef63b42845049c648b5d90f1c4d
|
|
||||||
1
pack/general/start/friendly-snippets
Submodule
1
pack/general/start/friendly-snippets
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit d27a83a363e61009278b6598703a763ce9c8e617
|
||||||
1
pack/general/start/nvim-cmp
Submodule
1
pack/general/start/nvim-cmp
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit df6734aa018d6feb4d76ba6bda94b1aeac2b378a
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 5fc4862eea9bc72cf0f03c56a4a09fd76d9fee35
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 11c771065bfadcc0583b9711d3932c765f168bb4
|
|
||||||
Loading…
Add table
Reference in a new issue