diff options
author | xeluxee <[email protected]> | 2021-09-17 18:39:26 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-09-17 21:09:26 +0430 |
commit | 87d36102919df97ec15af4c916e37888cee279cd (patch) | |
tree | f1bac86ff7c51a884e851f1c419ee07f56538836 /lua/core/autopairs.lua | |
parent | 390f277b702fe7877f0d5fabbece230528b58cb1 (diff) |
[Bugfix]: latex completion: insert `{` instead of `(` when completing (#1566)
Diffstat (limited to 'lua/core/autopairs.lua')
-rw-r--r-- | lua/core/autopairs.lua | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lua/core/autopairs.lua b/lua/core/autopairs.lua index b728cbc1..a67f3b07 100644 --- a/lua/core/autopairs.lua +++ b/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 = lvim.builtin.autopairs.map_cr, + map_complete = lvim.builtin.autopairs.map_complete, + auto_select = lvim.builtin.autopairs.auto_select, + insert = lvim.builtin.autopairs.insert, + map_char = lvim.builtin.autopairs.map_char, } end |