Sunteți pe pagina 1din 2

Two Modes

1)Noraml Mode (press Esc)


2)Insert Mode (press i)
3)Visual Mode

Insert Mode:-
i-Insert
r-replace
:w-Save the file
:q-quit the file
:wq-save and quit the file
:w!-save with overwrite
:q!-quit
u-undo
:E-Exploree
.-To Repeat the previous action
^-Indicate the starting of the line
$-Indicate the end of the line
:set nu or :set number->To set the line number
:set nonu->Hide the line number
yy-yank current line(copy)
p-paste
3yy-copy the 3 lines
3p paste the copied lines 3 times
:30 or :n-go to nth line directly
gg-to begging of the line
G-go to last line of the page
H-Cursor to the top line of the screen
M-Move the cursor to the middle of the line of the screen
L- Move the cursor to the last line of the screen
1G-Move cursor to the first line of the file
dw-delete the word from place of the cursor till next word
:sp file1 ->split the screen horsizotally and open the file1
:vsp file1->Split the screen vertically and open the file
(ctrl)+ww->move the cursor from one file to other file in split window
:e-To reload the opened file
*search a word ,place cursor on any word to be searched and press * and n ->forward
and N-backward
:g//d delete the lines which contains previous searched pattern
:g!//d->This will delete the other lines which doesn't contain previous searched
pattern
gf->open the filename under the cursor i.e place the file path adn press gf
ctrl+w+f-> split the window and open a file
place a cursor on file path and press ctrl+w+f
ctrl+p->Auto fill ,while typing ctrl+p will shows the auto fill words
ctrl+x+f->auto fill the path.
while typing any path,ctrl+x+f auto fills the path

:%s/cat/dog/gnc->replace the string cat with dog wher g-indicates teh gloabl
and c- conditional replacement,asks for replacement n-count no of times
occures
%s/^/dog/gc->add dog in begging of all the line

ctrl+a->increment number ,place cursor on any number and press "ctrl+a",then the
number will be increamented by 1
ctrl+x->decreament number,place cursor on any number and press "ctrl+x" then the
number will be decremented by 1

u-undo
For Movement of the Key up-down-left-right
Up movement(K/UP Arrow Key)
Down movement(J/Down Arrow Key)
Left movement(H/Left Arrow Key)
Right movement(L/Right Arrow Key)

In order to do the movements on the word it work plain as well as with number
w-Start of the next word
e-end of the word
b-Beginning of the word
w->plain 3w->it mean moves to 3rd word

For the repeative things


Esc-4-i-j-Esc=>jjjj(4 times will be printed)+Esc
Esc(Mode)-No of time the things need to repeat-insert
mode-charcher-Esc Mode

:goto 100=>will take you to the 100th place


:w ->save
:wq->save n quit
:q ->quit
:q!->quit without saving

u->undo
ctrl+R->Redo
:help->Help
dw->delete word
d->delete
p->paste
r->replace

S-ar putea să vă placă și