Here a quick tips to master Vim editor
To exit insert mode, Press
EscTo save & exit
:wqTo open the same filename again
vi filename.txtThat's it, let's to explore more commands ..
To show ruler
:set ruler
To make the ruler clear
File
Write w
Quit q
:set laststatus=2To set line number
:set numberTo set code syntax highlight
:syntax on
File
Write w
Quit q
Write & quit wq
Write as w newfilename.txt
Force quit q!
Overwrite w! existfilename.txt
Open e filename.txt
Back e#
New new filename.txt
Edit
Undo u
Redo ctrl + r
Highlights v
Select all %y
Copy y
Copy current line yy
Cut d or x
Paste p
Delete highlighted text d
Delete next word dw
Delete next char x
Delete entire line dd
Moving around
Left h
Down j
Up k
Right l
Windows
Split window sp filename
Split window sp filename
Vertical split window vsp filename
Switch window ctrl + ww
Tabs
New tab tabnew
Next tab gt
Previous tab gT
Close tab tabc
Commands
Open shell shell
Exist shell exit
Navigation
Insert at end of current line A
Top H
End L
Start of line 0
End of line $
Back by word b
Forward by word w
Up by page ctrl + u
Down by page ctrl + d
Go to line ?G
begging of block {
end of block }
Find & Replace
Find /?
Next n
Previous N
Replace all %s/old/new
Mellisounce
Clean Vim vi —clean file.txt
About version
No comments:
Post a Comment