VIM复合命令

VIM提供了很多 复合命令,可以把两个动作合并为一次按键。极大提高了编辑效率。以下是一些具体的例子:

|------|--------|-----------|
| 复合命令 | 等效的长命令 | 说明 |
| C | c | 删除光标到行尾 | | s | cl | 删除光标位置的字符 | | S | \^C | 删除整行 | | I | \^i | 光标移动到行首 | | A | a | 光标移动到行尾 |
| o | A + 回车 | 光标下方开启一行 |
| O | ko | 光标上方开启一行 |

除了表中说明的功能之外,这些命令还有一个共同特点:它们都会从普通模式切换到插入模式。结合重复命令.将产生奇特的反应。

假设文本内容:

复制代码
Maximum length of a custom vocabulary phrase    Each supported Region: 256  No  The maximum number of characters in a custom vocabulary phrase.
Number of StartMedicalStreamTranscription Websocket requests    Each supported Region: 25   Yes The maximum number of StartMedicalStreamTranscription Websocket requests.                                                                                                  
Number of StartMedicalStreamTranscription Websocket requests    Each supported Region: 25   Yes The maximum number of StartMedicalStreamTranscription Websocket requests.
Number of StartStreamTranscription Websocket requests   Each supported Region: 25   Yes The maximum number of StartStreamTranscription Websocket requests that you can make per second from this account in the current Region.
Number of concurrent HTTP/2 streams for streaming transcription.    Each supported Region: 25   Yes The maximum number of concurrent stream transcription jobs in this account in the current Region
Number of concurrent batch transcription jobs   Each supported Region: 250  Yes The maximum number of concurrent transcription jobs in this account in the current Region
Number of concurrent medical batch transcription jobs   Each supported Region: 250  Yes The maximum number of concurrent medical batch transcription jobs.
Number of concurrent medical batch transcription jobs   Each supported Region: 250  Yes The maximum number of concurrent medical batch transcription jobs.

现在要隔行在 Number 之前加上The,用列编辑不适用,就可以用组合指令加.来简化操作:

  1. 光标移动到第二行任意位置
  2. 执行命令I ,这时光标移到行首并转为编辑模式
  3. 输入 The ,并按Esc
  4. 重复执行jj.
相关推荐
小和尚同志43 分钟前
29.4k!使用 1Panel 来管理你的服务器吧
linux·运维
帽儿山的枪手1 小时前
为什么Linux需要3种NAT地址转换?一探究竟
linux·网络协议·安全
shadon1789 天前
回答 如何通过inode client的SSLVPN登录之后,访问需要通过域名才能打开的服务
linux
小米里的大麦9 天前
014 Linux 2.6内核进程调度队列(了解)
linux·运维·驱动开发
算法练习生9 天前
Linux文件元信息完全指南:权限、链接与时间属性
linux·运维·服务器
忘了ʷºᵇₐ9 天前
Linux系统能ping通ip但无法ping通域名的解决方法
linux·服务器·tcp/ip
浩浩测试一下9 天前
渗透测试指南(CS&&MSF):Windows 与 Linux 系统中的日志与文件痕迹清理
linux·运维·windows·安全·web安全·网络安全·系统安全
敏叔V5879 天前
大模型Text2SQL之在CentOS上使用yum安装与使用MySQL
linux·mysql·centos
切韵9 天前
Unity编辑器扩展:UI绑定复制工具
ui·unity·编辑器
小生云木9 天前
Linux离线编译安装nginx
linux·运维·nginx