apt-get install vim less update-alternatives --set vi /usr/bin/vim.basic update-alternatives --set editor /usr/bin/vim.basic
Commands
i - opens insert mode for editing, inserts text after the current cursor positionesc - returns to command mode
a - opens insert mode for editing, inserts text at the current cursor position
:w - writes changes
:wa - writes all changes
:x or ZZ - writes and quits
:q! or ZQ - quits without saving changes
:xa - writes and quits all windows
Text Manipulation
u - undov - enters visual mode to mark a block on which you can use commands
d - deletes the current selection
y - yanks (copies) the current selection
p - paste
gq - reformat paragraph
Moving around
gg - top of the fileG - bottom of the file
/text - search forward
n - next match
N - previous match
?text - search backward
:%s/old/new/g - replace old with new globally
Multi-windowing
^ws - horizontal split^wv - vertical split*
^wc - close current window
^w up arrow - move cursor up a window
^w_ - maximize current window
^w= - make all equal size
No comments :
Post a Comment