ux and editing plugins configured
This commit is contained in:
parent
ab42f6cebc
commit
9a03d01844
8 changed files with 193 additions and 13 deletions
33
lua/plugins/autopairs.lua
Normal file
33
lua/plugins/autopairs.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
-- Phase 6.5: nvim-autopairs for auto-closing brackets, quotes, etc.
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
config = function()
|
||||
local autopairs = require('nvim-autopairs')
|
||||
|
||||
autopairs.setup({
|
||||
check_ts = true, -- Use treesitter to check for valid pair
|
||||
ts_config = {
|
||||
lua = { 'string' }, -- Don't add pairs in lua string treesitter nodes
|
||||
javascript = { 'template_string' }, -- Don't add pairs in JS template strings
|
||||
php = { 'string' }, -- Don't add pairs in PHP strings
|
||||
},
|
||||
disable_filetype = { 'TelescopePrompt', 'vim' },
|
||||
fast_wrap = {
|
||||
map = '<M-e>', -- Alt+e for fast wrap
|
||||
chars = { '{', '[', '(', '"', "'" },
|
||||
pattern = [=[[%'%"%>%]%)%}%,]]=],
|
||||
end_key = '$',
|
||||
keys = 'qwertyuiopzxcvbnmasdfghjkl',
|
||||
check_comma = true,
|
||||
highlight = 'Search',
|
||||
highlight_grey = 'Comment',
|
||||
},
|
||||
})
|
||||
|
||||
-- Integration with nvim-cmp
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
local cmp = require('cmp')
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue