nvim: Update autopairs config
This commit is contained in:
parent
2e8d1b8ee1
commit
d3a56aaaf4
@ -5,18 +5,12 @@ return {
|
|||||||
dependencies = {
|
dependencies = {
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function(_, opts)
|
||||||
-- import nvim-autopairs
|
-- import nvim-autopairs
|
||||||
local autopairs = require("nvim-autopairs")
|
local autopairs = require("nvim-autopairs")
|
||||||
|
|
||||||
-- configure autopairs
|
-- configure autopairs
|
||||||
autopairs.setup({
|
autopairs.setup(opts)
|
||||||
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
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- import nvim-autopairs completion functionality
|
-- import nvim-autopairs completion functionality
|
||||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
@ -27,4 +21,11 @@ return {
|
|||||||
-- make autopairs and completion work together
|
-- make autopairs and completion work together
|
||||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
end,
|
end,
|
||||||
|
opts ={
|
||||||
|
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
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user