[nvim] new plugin : autopairs

This commit is contained in:
David JULIEN 2021-10-30 15:29:14 +02:00
parent 73ac47a773
commit a532830d77
2 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,7 @@
local cmp = require("cmp") local cmp = require("cmp")
local luasnip = require("luasnip") local luasnip = require("luasnip")
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local t = function(str) local t = function(str)
return vim.api.nvim_replace_termcodes(str, true, true, true) return vim.api.nvim_replace_termcodes(str, true, true, true)
@ -17,6 +18,9 @@ local check_backspace = function()
sub(col, col):match('%s') == nil sub(col, col):match('%s') == nil
end end
-- If you want insert `(` after select function or method item
cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
cmp.setup { cmp.setup {
completion = { completion = {
autocomplete = false autocomplete = false

View File

@ -86,6 +86,12 @@ return require("packer").startup(function()
config = function() require("plugin.comment") end config = function() require("plugin.comment") end
} }
-- autopairs
use {
"windwp/nvim-autopairs",
config = function() require('nvim-autopairs').setup() end
}
-- display colors directly in editor -- display colors directly in editor
use { use {
"norcalli/nvim-colorizer.lua", "norcalli/nvim-colorizer.lua",