gpt4 book ai didi

vim - vimrc中 'inoremap'是什么意思

转载 作者:行者123 更新时间:2023-12-03 10:56:18 24 4
gpt4 key购买 nike

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com