vimrc
示例文件下面有一行
inoremap Ctrl-u Ctrl-G u Ctrl-u
inoremap
的含义是什么,此行的功能是什么?
最佳答案
vim
:help inoremap
对此很有诗意:
:ino[remap] {lhs} {rhs} mapmode-i :ino :inoremap
:ln[oremap] {lhs} {rhs} mapmode-l :ln :lnoremap
:cno[remap] {lhs} {rhs} mapmode-c :cno :cnoremap
Map the key sequence {lhs} to {rhs} for the modes
where the map command applies. Disallow mapping of
{rhs}, to avoid nested and recursive mappings. Often
used to redefine a command. {not in Vi}
因此,它为^ U进行了一些插入模式映射,这些映射显示了文件名(
^G
,撤消了最近的更改(u
),并将缓冲区向上滚动了半屏(^U
)。除了演示
inoremap
功能外,我不知道为什么有人会想要此特定命令序列-处的^U
指的是创建定义时命令所具有的含义,而不是回调到重新定义的^U
映射中。
关于vim - vimrc中 'inoremap'是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9221769/