diff options
Diffstat (limited to 'lua/lvim/core/autopairs.lua')
-rw-r--r-- | lua/lvim/core/autopairs.lua | 74 |
1 files changed, 35 insertions, 39 deletions
diff --git a/lua/lvim/core/autopairs.lua b/lua/lvim/core/autopairs.lua index c7033d2b..263c8126 100644 --- a/lua/lvim/core/autopairs.lua +++ b/lua/lvim/core/autopairs.lua @@ -1,47 +1,43 @@ local M = {} function M.config() - local config = { - opts = { - ---@usage check bracket in same line - enable_check_bracket_line = false, - ---@usage check treesitter - check_ts = true, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]], "%s+", ""), - enable_moveright = true, - ---@usage disable when recording or executing a macro - disable_in_macro = false, - ---@usage add bracket pairs after quote - enable_afterquote = true, - ---@usage map the <BS> key - map_bs = true, - ---@usage map <c-w> to delete a pair if possible - map_c_w = false, - ---@usage disable when insert after visual block mode - disable_in_visualblock = false, - ---@usage change default fast_wrap - fast_wrap = { - map = "<M-e>", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "Search", - highlight_grey = "Comment", - }, + lvim.builtin.autopairs.opts = { + ---@usage check bracket in same line + enable_check_bracket_line = false, + ---@usage check treesitter + check_ts = true, + ts_config = { + lua = { "string", "source" }, + javascript = { "string", "template_string" }, + java = false, + }, + disable_filetype = { "TelescopePrompt", "spectre_panel" }, + ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]], "%s+", ""), + enable_moveright = true, + ---@usage disable when recording or executing a macro + disable_in_macro = false, + ---@usage add bracket pairs after quote + enable_afterquote = true, + ---@usage map the <BS> key + map_bs = true, + ---@usage map <c-w> to delete a pair if possible + map_c_w = false, + ---@usage disable when insert after visual block mode + disable_in_visualblock = false, + ---@usage change default fast_wrap + fast_wrap = { + map = "<M-e>", + chars = { "{", "[", "(", '"', "'" }, + pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), + offset = 0, -- Offset from pattern match + end_key = "$", + keys = "qwertyuiopzxcvbnmasdfghjkl", + check_comma = true, + highlight = "Search", + highlight_grey = "Comment", }, } - ---@cast config +LvimBuiltin - require("lvim.core.builtins").extend_defaults(config) - lvim.builtin.autopairs = config + lvim.builtin.autopairs = require("lvim.core.builtins").add_completion "autopairs" end local function on_confirm_done(...) |