1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-11-20 13:11:14 +00:00
dotfiles/.config/nvim/lua/plugins/autopairs.lua

32 lines
754 B
Lua
Raw Normal View History

2022-10-01 11:46:18 +00:00
-- Setup nvim-cmp.
local status_ok, npairs = pcall(require, "nvim-autopairs")
if not status_ok then
return
end
npairs.setup({
2022-10-12 14:02:54 +00:00
check_ts = true,
2022-10-08 10:44:11 +00:00
disable_filetype = { "TelescopePrompt", "neo-tree" },
ts_config = {
lua = { "string", "source" },
},
fast_wrap = {
map = "<M-e>",
chars = { "{", "[", "(", '"', "'" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
2022-10-12 14:02:54 +00:00
offset = 0,
2022-10-08 10:44:11 +00:00
end_key = "$",
keys = "qwertyuiopzxcvbnmasdfghjkl",
check_comma = true,
highlight = "PmenuSel",
highlight_grey = "LineNr",
},
2022-10-01 11:46:18 +00:00
})
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
end
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({}))