level 1
inoremap () ()<Left>
inoremap [] []<Left>
inoremap {} {}<Left>
inoremap ) <c-r>=ClosePair(')')<CR>
inoremap ] <c-r>=ClosePair(']')<CR>
inoremap } <c-r>=ClosePair('}')<CR>
function! ClosePair(char)
if getline('.')[col('.')-1]==a:char
return "\<Right>"
else
return a:char
endif
endfunction
2021年04月10日 06点04分
4
哥们。这个function函数从哪里学的,有教程吗
2021年06月05日 16点06分
@年年有于good 【手把手教你开发Neovim(Vim)插件—无废话系列之最强文本编辑器应该这么学-哔哩哔哩】https://b23.tv/kvFg4Y
2021年07月28日 00点07分