summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/opts.lua
diff options
context:
space:
mode:
authorAdam <adam.moloney.stuck@gmail.com>2021-10-15 22:06:05 +0200
committeradamstuck <adam.moloney.stuck@gmail.com>2021-10-17 18:00:24 +0200
commited39ec8685f47af72ec149f366be42baa1b801ad (patch)
tree313b6d9db8ae36967f8c46ca8dc9101b93dba6e3 /.config/nvim/lua/opts.lua
parent38949564a4325616be0c3b2b67e693db3a62b88f (diff)
Nvim setup autopairs
Diffstat (limited to '.config/nvim/lua/opts.lua')
-rw-r--r--.config/nvim/lua/opts.lua20
1 files changed, 16 insertions, 4 deletions
diff --git a/.config/nvim/lua/opts.lua b/.config/nvim/lua/opts.lua
index a67a07a..157c899 100644
--- a/.config/nvim/lua/opts.lua
+++ b/.config/nvim/lua/opts.lua
@@ -30,10 +30,10 @@ cmp.setup {
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-e>'] = cmp.mapping.close(),
- ['<CR>'] = cmp.mapping.confirm {
- behavior = cmp.ConfirmBehavior.Replace,
- select = true,
- },
+ -- ['<CR>'] = cmp.mapping.confirm {
+ -- behavior = cmp.ConfirmBehavior.Replace,
+ -- select = true,
+ -- },
["<Tab>"] = cmp.mapping(function(fallback)
if vim.fn["UltiSnips#CanJumpForwards"]() == 1 then
vim.fn.feedkeys(t("<ESC>:call UltiSnips#JumpForwards()<CR>"))
@@ -56,6 +56,18 @@ cmp.setup {
}
vim.cmd('autocmd FileType markdown lua require("cmp").setup.buffer { enabled = false }')
+require('nvim-autopairs').setup{}
+require("nvim-autopairs.completion.cmp").setup {
+ map_cr = true, -- map <CR> on insert mode
+ map_complete = true, -- it will auto insert `(` (map_char) after select function or method item
+ auto_select = true, -- automatically select the first item
+ insert = false, -- use insert confirm behavior instead of replace
+ map_char = { -- modifies the function or method delimiter by filetypes
+ all = '(',
+ tex = '{',
+ },
+}
+
-- C#
local pid = vim.fn.getpid()