0% found this document useful (0 votes)
4 views

vim

The document provides a comprehensive guide on using Vim, detailing command modes, navigation, editing, and text manipulation commands. It includes specific commands for saving, quitting, searching, and advanced features like window splitting. Additionally, it outlines basic navigation and editing in both normal and insert modes.

Uploaded by

M.S. FARHAD
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

vim

The document provides a comprehensive guide on using Vim, detailing command modes, navigation, editing, and text manipulation commands. It includes specific commands for saving, quitting, searching, and advanced features like window splitting. Additionally, it outlines basic navigation and editing in both normal and insert modes.

Uploaded by

M.S. FARHAD
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Command mood >> Esc key

Insert mood >> i a o I A O

Execution/ Command mood :

:w Enter then file save.


:wq Enter then save & quit
:q Quit
:q! Forcefull quit
:wq! Forcefull write & quit
:x Save & quit
:x! Forcefull save & quit

set virtual line >> :set nu


remove virtual line >> :set nu!

Search then: /coffee

/<word>
/
:<number>
:%s/<search>/<replace>
:%s/<coffee>/<tea>/g
:%s/<coffee>/<tea>/gc

UNSELECT :<------>!

To go first line >> double gg


To go last line >> shift + g
To go 50 no line >> :50

copy (yy) double y >> yank


past >> p
cut (dd) >> double d
undo >> u
copy 6 line then >> 6yy
past 2p then past 2lines

10dd >> 10 lines cut or delete


###################################################################################
########
>> Basic Navigation in Normal Mode:
Command Action:

h Move left
l Move right
j Move down
k Move up
0 Move to beginning of the line
^ Move to first non-blank character of the line
$ Move to end of the line
gg Move to beginning of the file
G Move to end of the file
Ctrl + d Scroll down half a screen
Ctrl + u Scroll up half a screen

>> Editing in Insert Mode:


Command Action:
i Insert before cursor
I Insert at beginning of the line
a Append after cursor
A Append at end of the line
o Open a new line below cursor
O Open a new line above cursor

>> Deleting and Copying Text:


Command Action:
x Delete character under cursor
dd Delete entire line
dw Delete word
D Delete from cursor to end of line
yy Copy (yank) a line
yw Copy a word
p Paste copied content

>> Advanced Features:


Splitting Windows:
- Horizontal split: :split filename or Ctrl + w s
- Vertical split: :vsplit filename or Ctrl + w v
Switch between splits: Ctrl + w + arrow keys

# vimtutor >> :help


-----------------------------------------------------------------------------------
--------

You might also like