CuSO4_Deposit's Electrolytic Infodump

Vim commands quickref

Move cursor

h and l : Left and Right. k and j : Up and Down.

Basic Edit

i: enter insert mode, cursor is before the highlighted character. a: enter insert mode, cursor is after the highlighted character.

:wq: save and quit. :q!: quit and do not save.

Delete and Undo

x: delete the current highlighted character.

d: delete. Its basic format is d .

motion: w: move cursor to the next word’s first letter. e: move cursor to the current word’s last letter. $: move cursor to the end of this line.

then Delete Operation: dw: delete until cursor get to the first letter of the next character. d2e: do {delete until deleted the end of the current letter} twice. … … dd: delete the whole line (and put it into the register).

u: undo. U: undo all the operations to this line. +R: redo.

Paste and Change

p: add things in register after the current cursor. r: keep in normal mode, replace the current character with .

c: change. It has the same format with d. cw: delete from cursor to the end of this word, and enter insert mode.

Locate and File status

+G: show which line the cursor is at, and file status. G: jump to the last line of this file. G: jump to the th line of the file. gg: jump to the first line of this file.

Search and Replace

/: search in this file. ?: search in this file, in reverse direction. n: move to the next found. N: move to the previous found. +O: cursor back to the previous location. +I: cursor to the newer location. %: when cursor is on a brace/bracket, jump to the paired one. :s//: replace the first in the cursor’s line with :s///g: replace all the in the cursor’s line with :,s///g: replace all the from to with :%s///g: replace all the in the file with :%s///gc: replace all the in the file with , but prompt whether to substitute at each one.

External Command

:!: execute command in cmd.

File Operation

:w : save a new file at this dir. v (motion) :w: save the selected part into . :r : insert the content of to the cursor line. :r !: read the output of external command and insert below the cursor line.

Open and Append

o: open a line below the cursor line. O: open a line above the cursor line. R: enter replace mode. y: copy. p: paste. yw: copy a word.

Set

:set : set some options. e.g. :set ic means (ignore case), works when find and replace.

#Quickref #vim