feat(nvim)!: use nvim autopairs instead of mini

nixos
Moritz Böhme 2023-09-07 08:39:43 +02:00
parent 78bad01914
commit 116fc30524
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
3 changed files with 30 additions and 1 deletions

View File

@ -79,6 +79,12 @@ with builtins;
conf = readFile ./nvim-cmp.lua; conf = readFile ./nvim-cmp.lua;
event = [ "InsertEnter" ]; event = [ "InsertEnter" ];
dependencies = [ dependencies = [
{
plugin = nvim-autopairs;
conf = /* lua */ ''
require("nvim-autopairs").setup({})
'';
}
{ plugin = cmp-async-path; } { plugin = cmp-async-path; }
{ plugin = cmp-buffer; } { plugin = cmp-buffer; }
{ plugin = cmp-cmdline; } { plugin = cmp-cmdline; }

View File

@ -1,6 +1,5 @@
require("mini.align").setup() require("mini.align").setup()
require("mini.move").setup() require("mini.move").setup()
require("mini.pairs").setup()
require("mini.starter").setup() require("mini.starter").setup()
require("mini.statusline").setup({ require("mini.statusline").setup({

View File

@ -77,3 +77,27 @@ cmp.setup.cmdline(":", {
{ name = "cmdline" }, { name = "cmdline" },
}), }),
}) })
-- If you want insert `(` after select function or method item
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local handlers = require("nvim-autopairs.completion.handlers")
cmp.event:on(
"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["*"],
},
},
-- Disable for functional languages
haskell = false,
nix = false,
},
})
)