From be4229102833c43aa5355d0b55e1737e6c343767 Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Tue, 6 May 2025 03:06:01 +0800 Subject: [PATCH] feat nvim: add autopairs --- .../exact_plugins/exact_editor/autopairs.lua | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 dot_config/nvim/exact_lua/exact_plugins/exact_editor/autopairs.lua diff --git a/dot_config/nvim/exact_lua/exact_plugins/exact_editor/autopairs.lua b/dot_config/nvim/exact_lua/exact_plugins/exact_editor/autopairs.lua new file mode 100644 index 0000000..df6d3d1 --- /dev/null +++ b/dot_config/nvim/exact_lua/exact_plugins/exact_editor/autopairs.lua @@ -0,0 +1,28 @@ +return { + { + 'windwp/nvim-autopairs', + event = "InsertEnter", + config = true, + -- use opts = {} for passing setup options + -- this is equivalent to setup({}) function + opts = { + enabled = function(bufnr) return true end, -- control if auto-pairs should be enabled when attaching to a buffer + disable_filetype = { "TelescopePrompt", "spectre_panel", "snacks_picker_input" }, + disable_in_macro = true, -- disable when recording or executing a macro + disable_in_visualblock = false, -- disable when insert after visual block mode + disable_in_replace_mode = true, + ignored_next_char = [=[[%w%%%'%[%"%.%`%$]]=], + enable_moveright = true, + enable_afterquote = true, -- add bracket pairs after quote + enable_check_bracket_line = true, --- check bracket in same line + enable_bracket_in_quote = true, -- + enable_abbr = false, -- trigger abbreviation + break_undo = true, -- switch for basic rule break undo sequence + check_ts = false, + map_cr = true, + map_bs = true, -- map the key + map_c_h = false, -- Map the key to delete a pair + map_c_w = false, -- map to delete a pair if possible + }, + }, +}