Movement
e go to end of the current word
b go to beginning of the current word
⇧ + $ go to an end of the current line
⇧ + ^ go to beginning of the current line
gg go to beginning of the file
⇧ + q go to end of the file
Searching
/ enter search (forward) mode
? enter search (back) mode
n next occurrence
General
u undo
o open new line below and go to insert mode
⇧ + o open new line above and go to insert mode
% jump to corresponding bracket
:q quit
:wq write changes & quit
:q! quit without saving changes
:q quit
:wq write changes & quit
:q! quit without saving changes
Text manipulation
x delete character being under cursor
r replace a single character being under cursor
c + e remove all characters from cursor to an and of given word
c + b remove all characters from cursor to beginning of the given word
c3e remove next 3 words
5dd remove next 5 lines
ci{ remove all content in between brackets
* highlight all occurrences of a current word
⇧ + v mark whole line
v mark a custom selection
yy copy whole line
y copy selection
d cut selection
p paste below
⇧ + p paste above
~/.vimrc
:set nocompatible "Use the newest features
:set number "Let's activate line numbers.
:set incsearch "Live search
:set hlsearch "Highlight search occurrences
:set autoindent "Auto indent in code
:syntax on "Syntax highlightning
:set mouse=a "Enable mouse
No comments:
Post a Comment