Enable nvim autopairs and some new completion sources
This commit is contained in:
parent
58b1563a8b
commit
b945ce338e
2 changed files with 17 additions and 0 deletions
|
@ -50,8 +50,18 @@ cmp.setup {
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'luasnip' },
|
{ name = 'luasnip' },
|
||||||
{ name = 'path' },
|
{ name = 'path' },
|
||||||
|
{ name = 'git' },
|
||||||
|
{ name = 'buffer' },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Enable autopairs when enter is processed
|
||||||
|
-- on completion
|
||||||
|
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
|
||||||
|
cmp.event:on(
|
||||||
|
'confirm_done',
|
||||||
|
cmp_autopairs.on_confirm_done()
|
||||||
|
)
|
||||||
|
|
||||||
-- load friendly-snippets to luasnip
|
-- load friendly-snippets to luasnip
|
||||||
require('luasnip/loaders/from_vscode').lazy_load()
|
require('luasnip/loaders/from_vscode').lazy_load()
|
||||||
|
|
|
@ -79,9 +79,16 @@ require('packer').startup(function()
|
||||||
use 'hrsh7th/nvim-cmp' -- Autocompletion plugin
|
use 'hrsh7th/nvim-cmp' -- Autocompletion plugin
|
||||||
use 'hrsh7th/cmp-nvim-lsp' -- LSP source for nvim-cmp
|
use 'hrsh7th/cmp-nvim-lsp' -- LSP source for nvim-cmp
|
||||||
use 'hrsh7th/cmp-path' -- Path source for nvim-cmp
|
use 'hrsh7th/cmp-path' -- Path source for nvim-cmp
|
||||||
|
use 'petertriho/cmp-git' -- Git source for nvim-cmp
|
||||||
|
use 'hrsh7th/cmp-buffer' -- Buffer source for nvim-cmp
|
||||||
use 'saadparwaiz1/cmp_luasnip' -- Snippets source for nvim-cmp
|
use 'saadparwaiz1/cmp_luasnip' -- Snippets source for nvim-cmp
|
||||||
use 'L3MON4D3/LuaSnip' -- Snippets plugin
|
use 'L3MON4D3/LuaSnip' -- Snippets plugin
|
||||||
use 'rafamadriz/friendly-snippets' -- Snippets collection
|
use 'rafamadriz/friendly-snippets' -- Snippets collection
|
||||||
|
-- Enable brackets for completions
|
||||||
|
use {
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
config = function() require("nvim-autopairs").setup {} end
|
||||||
|
}
|
||||||
|
|
||||||
-- treesitter syntax highlight
|
-- treesitter syntax highlight
|
||||||
use {
|
use {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue