2023-12-24 19:46:29 +01:00
|
|
|
require("nvim-autopairs").setup({})
|
2023-12-24 12:06:23 +01:00
|
|
|
|
2023-12-24 19:46:29 +01:00
|
|
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
|
|
|
local cmp = require("cmp")
|
|
|
|
local handlers = require("nvim-autopairs.completion.handlers")
|
2023-12-24 12:06:23 +01:00
|
|
|
|
|
|
|
cmp.event:on(
|
2023-12-24 19:46:29 +01:00
|
|
|
"confirm_done",
|
|
|
|
cmp_autopairs.on_confirm_done({
|
|
|
|
filetypes = {
|
|
|
|
-- "*" is a alias to all filetypes
|
|
|
|
["*"] = {
|
|
|
|
["("] = {
|
|
|
|
kind = {
|
|
|
|
cmp.lsp.CompletionItemKind.Function,
|
|
|
|
cmp.lsp.CompletionItemKind.Method,
|
|
|
|
},
|
|
|
|
handler = handlers["*"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
lua = {
|
|
|
|
["("] = {
|
|
|
|
kind = {
|
|
|
|
cmp.lsp.CompletionItemKind.Function,
|
|
|
|
cmp.lsp.CompletionItemKind.Method,
|
|
|
|
},
|
|
|
|
---@param char string
|
|
|
|
---@param item table item completion
|
|
|
|
---@param bufnr number buffer number
|
|
|
|
---@param rules table
|
|
|
|
---@param commit_character table<string>
|
|
|
|
handler = function(char, item, bufnr, rules, commit_character)
|
|
|
|
-- Your handler function. Inpect with print(vim.inspect{char, item, bufnr, rules, commit_character})
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
-- Disable for tex
|
|
|
|
tex = false,
|
|
|
|
sh = false,
|
|
|
|
bash = false,
|
|
|
|
zsh = false,
|
|
|
|
},
|
|
|
|
})
|
2023-12-24 12:06:23 +01:00
|
|
|
)
|