diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index b4c5091..eb8b83c 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,3 +1,4 @@ +require("opdavies.autopairs") require("opdavies.colours") require("opdavies.comment") require("opdavies.completion") diff --git a/nvim/.config/nvim/lua/opdavies/autopairs.lua b/nvim/.config/nvim/lua/opdavies/autopairs.lua new file mode 100644 index 0000000..f0ab653 --- /dev/null +++ b/nvim/.config/nvim/lua/opdavies/autopairs.lua @@ -0,0 +1,16 @@ +local status_ok, autopairs = pcall(require, "nvim-autopairs") +if not status_ok then + return +end + +autopairs.setup {} + +local cmp_status_ok, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp") +if not cmp_status_ok then + return +end + +local cmp = require('cmp') +cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({ + map_char = { tex = '' } +})) diff --git a/nvim/.config/nvim/lua/opdavies/plugins.lua b/nvim/.config/nvim/lua/opdavies/plugins.lua index 53e1a1d..d2ed204 100644 --- a/nvim/.config/nvim/lua/opdavies/plugins.lua +++ b/nvim/.config/nvim/lua/opdavies/plugins.lua @@ -33,6 +33,7 @@ return packer.startup(function() use 'tpope/vim-surround' use 'vim-test/vim-test' use 'voldikss/vim-floaterm' + use 'windwp/nvim-autopairs' use { 'mg979/vim-visual-multi', branch = 'master' } -- Themes