master #6
|
@ -1,10 +1,15 @@
|
||||||
|
" off with <A-p>
|
||||||
|
nmap <A-p> :lua require('nvim-autopairs').disable()<CR>
|
||||||
|
" on with <A-P>
|
||||||
|
nmap <A-P> :lua require('nvim-autopairs').enable()<CR>
|
||||||
|
|
||||||
|
" fix <CR> being not usable to select a completion item
|
||||||
|
inoremap <silent><expr> <cr> coc#pum#visible() ? coc#pum#confirm() :
|
||||||
|
\ "\<C-g>u\<c-r>=v:lua.require'nvim-autopairs'.autopairs_cr()\<CR>"
|
||||||
|
|
||||||
lua << EOF
|
lua << EOF
|
||||||
require("nvim-autopairs").setup {}
|
require("nvim-autopairs").setup {}
|
||||||
local Rule = require('nvim-autopairs.rule')
|
local Rule = require('nvim-autopairs.rule')
|
||||||
local npairs = require('nvim-autopairs')
|
local npairs = require('nvim-autopairs')
|
||||||
npairs.add_rule(Rule("<>","<>","rs"))
|
npairs.add_rule(Rule("<>","<>","rs"))
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
" fix <CR> being not usable to select a completion item
|
|
||||||
inoremap <silent><expr> <cr> coc#pum#visible() ? coc#pum#confirm() :
|
|
||||||
\ "\<C-g>u\<c-r>=v:lua.require'nvim-autopairs'.autopairs_cr()\<CR>"
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
local utils = {}
|
||||||
|
|
||||||
|
function M.map(mode, lhs, rhs, opts)
|
||||||
|
local options = { noremap = true }
|
||||||
|
if opts then
|
||||||
|
options = vim.tbl_extend("force", options, opts)
|
||||||
|
end
|
||||||
|
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||||
|
end
|
||||||
|
|
||||||
|
return utils
|
Loading…
Reference in New Issue