kickstart.nvim/lua/kickstart/plugins/autopairs.lua

32 lines
869 B
Lua

-- autopairs
-- https://github.com/windwp/nvim-autopairs
return {
'windwp/nvim-autopairs',
event = 'InsertEnter',
config = function()
require('nvim-autopairs').setup({
check_ts = true,
ts_config = {
lua = { 'string' }, -- it will not add a pair on that treesitter node
javascript = { 'template_string' },
java = false, -- don't check treesitter on java
},
disable_filetype = { 'TelescopePrompt', 'spectre_panel' },
fast_wrap = {
map = '<M-e>',
chars = { '{', '[', '(', '"', "'" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], '%s+', ''),
offset = 0, -- Offset from pattern match
end_key = '$',
keys = 'qwertyuiopzxcvbnmasdfghjkl',
check_comma = true,
highlight = 'PmenuSel',
highlight_grey = 'LineNr',
},
})
end,
}