Introduction to VIM
Normal mode (Default)
Default mode when you open a file.
Moving around
h
: leftj
: downk
: up-
l
: right ctrl+d
: page down-
ctrl+u
: page up gg
: going to the top-
G
going to the bottom b
jump one word back-
w
jump one word forward /text
searches for textn
go to next searchN
go to previous search#
backward search on word under cursor-
*
forward search on word under cursor $
jump to end of line0
jump to start of line
Visual mode v
Used for Selecting. Press esc
to go back to normal mode.
d
delete/cuty
copyu
undop
paste
Insert mode i
, I
, a
, A
Press esc
to go back to normal mode.
Command mode :
:12
jump to line
Exitting
:wq
Save and exit:q!
Exit without saving
Running commands :!
:!pwd
Find current working directory
Vim configuration
Add these to ~/.vimrc
set hlsearch
set incsearch
set autoindent
set smartindent
set ruler
syntax on
filetype plugin indent on