You are on page 1of 5

29-03-2022

---------------------------------------------------------------------------
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)

insert mode (edit mode) (indication: thin line)


(by pressing key -- i, o, insc, a etc we can go into insert 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

note: default copy/deletion is downwards


if you want upward
nd_upward key
11. undo
u
12. redo
cltrr
-----------------------------------------------------------------------------
31-03-2022
copy

13. copy, paste cut/delete


a. words
copy words
yw--- copy one word
nyw---- copy multiple lines
paste line
p ----paste one word
np ---- paste multiple word
b. cut/delete words
dw -- single words
ndw --- multiple words

14. search and substitute


a. go to the word and press*
type "/" in escape mode then type the pattern which you want to
search--- this usefull to search line also

to remove highlights
:noh
b. search and substitute
:%s/pattern to search/patern to replace/g

:%s/pattern to search/patern to replace/


Note: this above search and substitute is for entire file
Note: if you want to copy and paste in command line, use copy to
clipboard and paste( left top window)

if we want to search within limited range of lines

:lower range, upper range s/pattern to search/patern to replace/g

:lower range, upper range s/pattern to search/patern to replace/

15. other commands


x --- delte one character/ nx delete n charc
r--- replace one character/nr replace n chracter by one character
cw --- change word
ctrlp--- auto fill(only command used in insert mode, it shows all the
Words from all the files open in gvim window
ggVG---select all

note : opening file in new tab


:tabbnew filename.ext
================END OF GVIM BASIC=========================:

root configuration file for gvim


making change on settings.like apperance or font size set number color scheme.. and
save this
configuration

step1: open root configuration file


:vspl/spl/tabnew
:vspl~/.vimrc
vim---gvim related file
rc--- root file
~/ installation path
.vimrc--- "."' indicates the vimrc file is a hidden protected
from accidential deletion.. hidden file contains conf of shell --- shell is use
to interact with hardware
50-60% gvim command is used in unix

Step2: type the required configuration what a user needs

step 3; restart gvim

You might also like