VI常用命令

vi / vim 删除以及其它命令 Commands Comments dd 删除一行 d$ 删除以当前字符开始的一行字符 D 与d$同义 d 回车删除2行 ndd 删除以当前行开始的n行 dw 删除以当前字符开始的一个字 ndw 删除以当前字符开始的n个字 d) 删除到下一句的开始 d} 删除到下一段的开始 ndw 或 ndW 删除光标处开始及其后的 n-1 个字符。 d0 删至行首。 d$ 删至行尾。 ndd 删除当前行及其后 n-1 行。 x 或X 删除一个字符。 Ctrl+u 删除输入方式下所输入的文本。 R 恢复u的操作 J 把下一行合并到当前行尾 V 选择一行 ^V 按下^V后即可进行矩形的选择了 vaw 选择单词 viw 内部单词(无空格)… Continue reading VI常用命令

Vim notes

Column selection: Ctrl + V Replace Replace all A with B %s/A/B Find in current line find < f< Remove content between 2 characters For example, remove the content between [ and ]: [routeName] {ExampleRoutes[routeName].name}</Text Vim commands(go to the beginning of the line, find [, delete around ]): 0f[da[ Record/Play Macro command Begin to record… Continue reading Vim notes