加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

vimrc中“inoremap”的含义是什么?

发布时间:2020-12-15 18:53:34 所属栏目:安全 来源:网络整理
导读: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] {lh
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映射.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读