100% found this document useful (1 vote)
86 views2 pages

Comand

This document provides a summary of Vim commands including commands for navigation, editing, searching, replacing text, splitting windows, auto-filling, and incrementing/decrementing numbers. Some of the key commands are i for insert mode, :wq for write and quit, u for undo, * for searching for a word, and ctrl+w+f for splitting a window and opening a file.

Uploaded by

VENKATRAMAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
86 views2 pages

Comand

This document provides a summary of Vim commands including commands for navigation, editing, searching, replacing text, splitting windows, auto-filling, and incrementing/decrementing numbers. Some of the key commands are i for insert mode, :wq for write and quit, u for undo, * for searching for a word, and ctrl+w+f for splitting a window and opening a file.

Uploaded by

VENKATRAMAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Comand Description

i Insert
r replace
:w Write/Save the file
:q Quit the file
:wq Write/Save then quit
:w! Overwrite
:q! Quit
u Undo
:E Open File explorer
. To repeat the previous action
^ Indicates starting of line
$ Indicates end of line
:set nu To set line number, Enable line number view
:set nonu Hides line number, Disable line no view
yy Copy the line
p Paste the copied line
3yy To copy 3 lines
3p Paste the copied lines 3 times
:30   or :n To move cursor to 30th line and to move
nth line (n is numeric )
gg To move cursor to beginning of page, that is line
number 1
G To move cursor to last line of page
H To move cursor to the top line of screen
M To move cursor to the middle line of screen
L To move cursor to the last line of screen
1G To move cursor to the first line of file
dw To delete the word from place of cursor to till next
word
:sp file1 Split the screen horizontally and open file1
:vsp file1 Split the screen vertically and open file1
(ctrl)+ww To move cursor from one file to other file in split window
:e To re-load the opened file
* search a word:
place cursor on any word to be searched and press *
To find
next occurrence press n To find previous occurrence
press N
:g//d This will deletes the lines which contains previous
searched pattern
:g!//d This will deletes the other  lines which doesn’t
contains previous searched pattern
“ctrl+v” Visual Mode:
then  “down” or Pattern (Adding any text) will be added at the place of
“up”  then selection.
“I” then “pattern1”
then “esc”
gf open the file name under cursor:
Place a cursor on file path and press gf.
Ctrl+w+f split 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 word’s
ctrl+x+f Auto fill the path.
While  typing any
path,
ctrl+x+f auto fills the path
:%s/flower/rose/gc Replace the string flower by rose.
g –
indicates global
c-conditional replacement, asks for replacement
:%s/^/rose/gc add rose in beginning of all the line
ctrl+a Increment
number.
Place
cursor on any number and press “ctrl+a”, then the
number will be
incremented by 1.
ctrl+x Decrements
number.
Place
cursor on any number and press “ctrl+x”, then the
number will be
decremented by 1.

You might also like