linux vim common operations

vim

Character Class
  • H on the left and right k j i, the keyboard keys may also be moved in the direction
Word level
  • the first letter of the word b next word w e first letter of the next word in the last letter
Row-level
  • 0 of line $ end of line
delete
  • dd Delete cursor line
Document-level
  • gg document first line, the first character
  • G document last line, the first character
  • H screen header
  • L screen tail
copy
  • yy copy cursor line
  • Multi-line after nyy copy cursor
  • p Paste output
Edit mode
  • a cursor for entering characters from the
  • The cursor into the character i
  • o start a new line into the
  • s Delete character under the cursor and enter
replace
  • s / content to replace / replace content / the first row of the cursor
  • s / content to replace / replace content / g cursor line replace all
  • % S / content to replace / replace content / g All file contents are replaced
Settings Syntax Highlighting
  • syntax on (opened with vim .vimrc write)
Show Line Numbers
  • set nu (vim .vimrc opened with write)
Set the number of spaces to indent 4
  • set shiftwidth = 4 (with vim .vimrc open for writing)

Guess you like

Origin www.cnblogs.com/histyle/p/11074641.html