- go to the begging of the line
type: 0
- go to the end of the line
type: $
- undo
type: u
- redo
type: ctrl + r
- move word by word
type: w
- move backwards by word
type : b
- replace current char
type : r , then type new char on current char location
- delete current line
type: dd
- delete current word
type: dw
- delete current char
type : x
- copy current line
type: yy
- paste after a line
type : p
- paste before a line
type : P
- repeat previous one simple action
type : .
- move the below line to append current line
type: J
- go to bottom of the file
type : G
- go to top of the file
type : gg
- go to top/middle/bottom of the screen
type : H
type : M
type : L
- move to the end of the word
type : e
- search a pattern
type : /<pattern>
then type : n , to search forwards
or type: N, to search backwards
- show linenumber
type ":set number"
to no show the linenumber, type ":set nonumber"
- open file at linenumber n
type "vim +n targetFile" on the commandline
- search occurrence of the pattern old to new, and confirm the replacement each time
type ":%s/old/new/gc"
without confirmation, you can type ":%s/old/new/g"
- mark a line, then visit back later
to mark a line, press m, then a letter/symbol
to revisit, press single quote, then press the pre-defined letter/symbol
- go to a specific line number
<lineNumber>G
- forward/backward one screen
forward press: ctrl + f
backward press: ctrl + b
- split screen verticaly to show anotherFile
:vsplit <anotherFile>
- create or decrease number by 1
use Ctrl+A to increment (add to) the number under the cursor
use Ctrl+X to decrement it