Add autopairs plugin to neovim

This commit is contained in:
Tyler Kelley 2024-05-15 14:05:11 -05:00
parent 743c933a9b
commit 6db728529b
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,20 @@
local autopairs = require("nvim-autopairs")
-- configure autopairs
autopairs.setup({
check_ts = true, -- enable treesitter
ts_config = {
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
java = false, -- don't check treesitter on java
},
})
-- import nvim-autopairs completion functionality
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
-- import nvim-cmp plugin (completions plugin)
local cmp = require("cmp")
-- make autopairs and completion work together
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())

View File

@ -190,6 +190,7 @@ in
indent-blankline-nvim indent-blankline-nvim
nvim-treesitter.withAllGrammars nvim-treesitter.withAllGrammars
lualine-nvim lualine-nvim
nvim-autopairs
nvim-web-devicons nvim-web-devicons
nvim-cmp nvim-cmp
cmp-buffer cmp-buffer
@ -214,6 +215,7 @@ in
${builtins.readFile ../../config/nvim/options.lua} ${builtins.readFile ../../config/nvim/options.lua}
${builtins.readFile ../../config/nvim/keymaps.lua} ${builtins.readFile ../../config/nvim/keymaps.lua}
${builtins.readFile ../../config/nvim/plugins/alpha.lua} ${builtins.readFile ../../config/nvim/plugins/alpha.lua}
${builtins.readFile ../../config/nvim/plugins/autopairs.lua}
${builtins.readFile ../../config/nvim/plugins/auto-session.lua} ${builtins.readFile ../../config/nvim/plugins/auto-session.lua}
${builtins.readFile ../../config/nvim/plugins/cmp.lua} ${builtins.readFile ../../config/nvim/plugins/cmp.lua}
${builtins.readFile ../../config/nvim/plugins/nvim-tree.lua} ${builtins.readFile ../../config/nvim/plugins/nvim-tree.lua}