feat: add autopairs plugin

This commit is contained in:
Radu C. Martin 2024-12-13 16:24:52 +01:00
parent a0d7331f08
commit 9a000ff4e8
2 changed files with 30 additions and 0 deletions

29
lua/plugins/autopairs.lua Normal file
View file

@ -0,0 +1,29 @@
return {
'windwp/nvim-autopairs',
event = 'InsertEnter',
config = true,
-- use opts = {} for passing setup options
-- this is equivalent to setup({}) function
--
opts = {
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
},
fast_wrap = {
map = '<M-e>',
chars = { '{', '[', '(', '"', "'" },
pattern = [=[[%'%"%>%]%)%}%,]]=],
end_key = '$',
before_key = 'h',
after_key = 'l',
cursor_pos_before = true,
keys = 'qwertyuiopzxcvbnmasdfghjkl',
manual_position = true,
highlight = 'Search',
highlight_grey = 'Comment',
},
},
}