nvim-autopairs

This commit is contained in:
Ryan 2023-11-20 22:15:47 +08:00
parent 49081f4dfb
commit 00d144e1e3
3 changed files with 19 additions and 16 deletions

View File

@ -49,7 +49,7 @@ local plugins = {
},
{
"nvim-treesitter/nvim-treesitter-context",
event = {"BufReadPre", "BufNewFile"},
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
@ -75,18 +75,21 @@ local plugins = {
"L3MON4D3/LuaSnip"
}
},
{
"windwp/nvim-autopairs",
config = function()
require("plugins.nvim-autopairs")
end
},
},
event = { "InsertEnter", "CmdlineEnter" },
config = function()
require("plugins/cmp")
end
},
{
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {
map_c_w = true,
enable_check_bracket_line = true,
check_ts = true,
},
},
{
"Dynge/gitmoji.nvim",
ft = "gitcommit",

View File

@ -102,3 +102,12 @@ cmp.setup.cmdline(':', {
}
})
})
-- nvim-cmp
-- If you want insert `(` after select function or method item
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)

View File

@ -1,9 +0,0 @@
local npairs = require("nvim-autopairs")
npairs.setup({
map_bs = true,
map_cr = true,
map_c_w = true,
enable_check_bracket_line = true,
check_ts = true,
})