vim实用技巧学习笔记(3.不要自我重复)

来源:互联网 发布:拓扑图制作软件 编辑:程序博客网 时间:2024/06/05 15:18

在句尾添加分号是一个常用的操作,假设有如下文本

...We're waiting for content before the site can go live...
..If you are copy with this, let's go ahead with it...
...We'll launch as soon as we have copy..

    我们要在每一句的末尾加上分号,该如何操作?

    当光标在第一行的时候 在普通模式下按A 然后输入;然后按ESC,接着按J换行重复该操作

    当有重复操作的时候我们就应该想到 . 命令

     我们重新来过

光标在第一行的时候按下A然后输入;然后按下ESC,麻蛋好像没什么不同

接下来按j 再按下 . 发现了什么

...We're waiting for content before the site can og live...;
..If you are copy with this, let's go ahead with it...;
...We'll launch as soon as we have copy...

第二行末尾出现了分号,接下来继续按 j  . 发现第三行末尾也出现了分号

这就是  . 命令 的奇效, 它重复了 A;(ECS) 这三个命令 省调了许多重复的操作

0 0
原创粉丝点击