Gvim Basics
Gvim Basics
---------------------------------------------------------------------------
what is gvim
graphical Visually improved text editor
it has lot shortcut command to make our day today activity easy
Mode of operation
Two Modes of operation
escape( command mode) (indication: thick rect box)
(by pressing esc key we can go for escape mode)
commands
1. setting numbers
a set number/se nu
b deleting numbers
set nonumber/se nonu
2. open/create file
vertical split
vspl filename.ext
horizontal split
spl filename.ext
ex vspl halfadder.v
3. Activate Syntax for file file type
syntax on
syntax off
-----------------------------------------------------------------------------------
----------
30-03-2022
Q what is main intention gvim
A use 80% of keyboard and use 10% mouse
Commands
4. save/write file
:w--- save single file
save/write all file
:wa
5. .quit/exit file
:q-- quit single file
:qa -- quit all file
b save and quit
:wq
7. save and quit all file
:wqa
8. quitting without save
q!
9. Navigation
a gg ( no colon) go to the top of file
b G (no colon) go to the bottom of file
c moving between lines
h--> left
j--> down
k--> up
l--> right
d Moving multiple lines up and down
10k/10up_arrow key
10j---moving 10 lines down
e moving to specific line
:linenumber and press enter key
:55
f moving between files
ctrlw( use arrow key betweeen files )
(in this case mouse is better)
g maximize horizontal window
ctrlw_
h equall sze
ctrlw=
k word movement
w --> to move one word forward
nw ---> n is no of words
ex 5w
b--> back ward
10. copy, paste cut/delete
a. lines
copy lines
yy--- copy one line
nyy---- copy multiple line
paste line
p ----paste one line
np ---- paste multiple line
b. cut/delete line
dd -- single line
ndd --- multiple line
b. cut/delete line
dd -- single line
ndd --- multiple line
to remove highlights
:noh
b. search and substitute
:%s/pattern to search/patern to replace/g