Added more plugins
This commit is contained in:
parent
d350db2449
commit
9e5256058d
8 changed files with 260 additions and 42 deletions
28
lua/custom/plugins/autopairs.lua
Normal file
28
lua/custom/plugins/autopairs.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
dependencies = {
|
||||
'hrsh7th/nvim-cmp',
|
||||
},
|
||||
config = function()
|
||||
local autopairs = require 'nvim-autopairs'
|
||||
|
||||
autopairs.setup {
|
||||
check_ts = true, -- enable treesitter
|
||||
ts_config = {
|
||||
lua = { 'string' }, -- don't add pairs in lua string treesitter nodes
|
||||
javascript = { 'template_string' }, -- don't add pairs in javscript template_string treesitter nodes
|
||||
java = false, -- don't check treesitter on java
|
||||
},
|
||||
}
|
||||
|
||||
-- import nvim-autopairs completion functionality
|
||||
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
|
||||
|
||||
-- import nvim-cmp plugin (completions plugin)
|
||||
local cmp = require 'cmp'
|
||||
|
||||
-- make autopairs and completion work together
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue