Add nvim-autopairs plugin for better brackets and indenting
This commit is contained in:
parent
e78b5ec766
commit
2a09e9094f
5
config/nvim/lua/config/nvim-autopairs.lua
Normal file
5
config/nvim/lua/config/nvim-autopairs.lua
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
return {
|
||||||
|
disable_in_macro = true,
|
||||||
|
disable_in_visualblock = true,
|
||||||
|
check_ts = true,
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
local cmp = require "cmp"
|
local cmp = require "cmp"
|
||||||
local luasnip = require "luasnip"
|
local luasnip = require "luasnip"
|
||||||
|
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||||
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
|
@ -73,3 +74,5 @@ cmp.setup.cmdline(":", {
|
||||||
{ name = "cmdline" },
|
{ name = "cmdline" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
|
|
9
config/nvim/lua/plugins/nvim_autopairs.lua
Normal file
9
config/nvim/lua/plugins/nvim_autopairs.lua
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
return {
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
lazy = true,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
},
|
||||||
|
config = function() require("nvim-autopairs").setup(require "config.nvim-autopairs") end,
|
||||||
|
}
|
Loading…
Reference in a new issue