Gvim Keys
Gvim Keys
- Editor(writes)
Different editors
- Notepad ++
- Visual studio code
- Atom
- Word , ect
- GVim -? Focus?
- Sublime
Windows : GVIM
LINUX : VIM
WHy GVIM?
- Because of commanding ability (Linux commands support)
- Work flow is easy(commands)
- Fast and effective(Commands)
- Time saving (commands)
Number of modes:
1. Escape mode (ESC) : Command
2. Insert mode (Shift+I or i) : Insert word/sentences
Syntax highlight
: syntax on
// Few of the commands will applicable to only Linux OS and few will be applicable
to WIndows OS
Linux OS
: setf verilog
: setf vera
Open file
: vspl (Vertical split)
: spl (Horizontal split)
Save
: w
Save all(Only when multiple files needs to be saved)
: wa
Quit
: q
Quit all
: qa
New tab
: tabnew file.extension
: vspl .
-> . Current directory
Navigation
gg -> first line of the file
G -> Last line of the file
kajohl
10 line up
10k
10 lines down
10j
10 words left
10h
10 word right
10l
word movement
w - move one word forward
nw - move n words forwards
b - move one word backward
nb - move n words backward
Copy
yy - one line copy
nyy - n lines copy
Paste
p - Paste once
np - Paste n times
Delete
dd - delete one line
ndd - delete n lines
Undo operation
u
Redo operation
Ctrl + R
dG -> delete the lines from wherever you are till the end
dgg -> delete the lines from wherever you are till the top
:lower_range,upper_rangey
:lower_range,upper_ranged
Replace
r - one char replace
nr - n char's replace
Change word
cw - one word change
ncw - n word's change
:%s/pattern-to_search/pattern_to_replace/
:%s/pattern-to_search/pattern_to_replace/g
Upper to Lower
Shift+V , u
Change line
Shift+V -> Select line
c - change the line
Search
/pattern_to_search
?pattern-to_search
type Shift+8
n - searches down
Shift+N - searches up
:vspl Ctrl+D