Vim compiler

vi: Visual Interface vim:VI iMproved

vim mode

Command mode (default access command mode)   Input mode   Last line mode

Mode conversion

  • Command mode –> Input mode

i: In front of the current character of the cursor, change to input mode a: After the current character of the cursor, change to the input mode o: at the bottom of the current cursor line, change to the input mode

I: at the beginning of the line where the current cursor is located. Change to input mode A: At the end of the current cursor line, change to input mode O: at the top of the current cursor line, change to input mode @@ @@输入模式——>Command Mode

  • 键盘

EscCommand Mode –>Last Line Mode即可

即可
  • 键盘

Escvim +: After opening the file, the cursor is on the last line

@@@快快定位

vim +#: After opening the file, the cursor is at ##@@@vim +/PATTERN: Open the file and locate the first line of the line matched by PATTERN for the first time

Close the file : 打开文件后就光标处于最后一行 末行模式 Close the file :打开文件之后光标处于第#行 :q: Exit @ @@@:wq: Exit and save ( :wq <equivalent> :x)

:q!: Do not save and exit

  • :w
  • :Save @@@ @:w!: Forcibly save

命Let the mode close the file : 退出 ZZ: Double-tap the capital letter Z 移动球:不保存退出 :保存 :强行保存

: 连敲两次大写字母Z

: 左 :下 :上 :右 :移动#个字符

: 下一个单词的词首 :当前或下一个单词的词尾 :当前或下一个单词的词首

@@@ |:下: 下一个单词的词首 k:上l:右

  • #h
  • :###

字@移动: 绝对行首 @| ||: The first word of the next word :行首的第一个非空白字符 e: the ending of the current or next word

  • b
  • : the first or last word of the word

一字移动@ @@@w: The first word of the word e: the ending of the current or next word b: the current or the first word of the word @@@ @行内跳

0: Absolute line head

^: The first non-whitespace character at the beginning of the line $: Absolute line ending Inter-line jump :向下翻半屏 #G: Tune to ##@@@G: The last line

at the last line mode gives the line number directly :x和d

翻屏:删除光标所在的字符 Ctrl + f: Turn down one screen Ctrl + b: Turn up one screen Ctrl + d: Turn down half a screen @@@ @Ctrl + u:Up half screen 删除单单符:x and d

x

: Delete the character where the cursor is located

#x@d:d command in conjunction with the jump command #dw, #de,#dbdd: Delete the current cursor line #dd: Delete the next # line in the line where the current cursor is located

: Delete the # character at the location of the cursor and the back of the

末行模式:@@ @@:start,end + d eg:(:1,3d, means delete 1-3 lines)

.: indicates the current line $: the last line

+#: Down #行

paste command :用法同d

p: If you delete or copy the entire line, paste it below the line where the cursor is, if you copy or delete the content as If it is not a whole line, paste it to the end of the character where the cursor is located

P: If it is deleted or copied as the entire line of content, paste it to the top of the line where the cursor is located. If the copied or deleted content is not a whole line, then Paste to the front of the character where the cursor is located

Copy command

r y: Usage with d

Modify command: Delete content first, then convert to input mode

c| ||: Usage with d:撤销前一次的编辑操作,连续u命令撤销此前n次操作,一般最多五十次 Replace character command :直接撤销#次编辑操作 *撤销撤销:Ctrl + r

R: Replace mode

Undo editing operation

u: Undo the previous editing operation, continuous u command Cancel the previous n operations, usually up to 50 times

#u: directly cancel #Edit operation   * Cancellation: Ctrl + r Repeat last command :按矩形选取