` Vim Versatile commands

  • .

    • 通过 Normal Mode (命令行模式)下的 . 命令来重复上一次的修改操作. 上一次的修改意味着很多操作:Normal Mode 下删除一个或多个字符,单词,行, 如 x, dw, d$, dd 等;比如改变缩进的命令:>>, << 等.

    • 命令行模式下大多数命令对文本做出的修改,都可以使用 . 来重复;Insert Mode (编辑模式) 下做出的修改的重复取决于进入该模式的命令,加入,你通过 A 进入 Insert Mode, 在末尾添加了单词 end,按下 Esc, . 命令会在末尾重复添加单词 end.

1
2
3
4
5
6
7
8
9
10
11
12
#1. You are now in Normal Mode, you have the text like those below:

This is

# 2. Press A to enter Insert Mode and write text `end`
This is end

# 3. Press Esc to enter Normal Mode and press .(period), things will happen like this:
This is end end

# 4. mode dot, mode ` end`
This is end end end
  • 5. 表示重复执行多少次
  • Motions (光标的移动) 并不会改变任何事情,所以 . 并不会进行重复