There are two modes in Vim Editor Command mode and Insert mode.By default when we open a new file we are in command mode.
So to go from command mode to insert mode we enter i
and to go insert mode to command mode we use ESC
Open a new file
(1) type vim test (creates a file named test)
(2) type i ( switch to insert mode)
(3) enter text (any text)
(4) hit Esc key (switch back to command mode)
(5) type :wq (write file and exit vim)
Now these are the basic commands to work in vim.There are some other commands also.So first we need to enter into command mode that we can do by hitting ESC key and then.
To Save text :w
Quit without saving :q!
Continue Search :n
Line number :set nu
Copy :5yy(it will copy 5 lines starting from cursor)
Paste :p(will paste 5 lines that we copied earliar)
Delete :dd (will delete current line)