summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/core/autopairs.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/core/autopairs.lua')
-rw-r--r--.config/nvim/lua/core/autopairs.lua20
1 files changed, 15 insertions, 5 deletions
diff --git a/.config/nvim/lua/core/autopairs.lua b/.config/nvim/lua/core/autopairs.lua
index 8ea3094..0c9ec28 100644
--- a/.config/nvim/lua/core/autopairs.lua
+++ b/.config/nvim/lua/core/autopairs.lua
@@ -7,8 +7,16 @@ function M.config()
---@usage map <CR> on insert mode
map_cr = true,
---@usage auto insert after select function or method item
- -- NOTE: This should be wrapped into a function so that it is re-evaluated when opening new files
- map_complete = vim.bo.filetype ~= "tex",
+ map_complete = true,
+ ---@usage automatically select the first item
+ auto_select = true,
+ ---@usage use insert confirm behavior instead of replace
+ insert = false,
+ ---@usage -- modifies the function or method delimiter by filetypes
+ map_char = {
+ all = "(",
+ tex = "{",
+ },
---@usage check treesitter
check_ts = true,
ts_config = {
@@ -52,9 +60,11 @@ M.setup = function()
if package.loaded["cmp"] then
require("nvim-autopairs.completion.cmp").setup {
- map_cr = true, -- map <CR> on insert mode
- map_complete = true, -- it will auto insert `(` after select function or method item
- auto_select = true, -- automatically select the first item
+ map_cr = options.builtin.autopairs.map_cr,
+ map_complete = options.builtin.autopairs.map_complete,
+ auto_select = options.builtin.autopairs.auto_select,
+ insert = options.builtin.autopairs.insert,
+ map_char = options.builtin.autopairs.map_char,
}
end