# Text editor - vi/vim
## Command Mode (default)
### Basic movement
h left
j down
k up
l right
^ go to beginning of the line
$ go to the end of the line
gg go to the first line
G go to the last line
w Move by word to 'start'
e Move by word to 'end'
:n Go to line n(:set nu display line number)
### Deleting Text
x delete character
dd delete line
dw delete word
### Copy/paste
yy yank line
p paste after cursor
P paste before cursor
### Undo/Redo
u undo
Ctrl r redo
## Insert Mode
### Inserting Text
i insert an cursor
I insert an the beginning of the line
a append after cursor
A append at the end of the line
o open a new line below the current line
O open a new line above the current line
### Save and Quit
:w Write(save)
:wq Write and quit
:q Quit
:q! Force quit, don't save changes
:wq! Force write and quit
## Visual Mode
v start visual mode
V start linewise visual mode
No comments:
Post a Comment