Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basic gvim commands.

Similar presentations


Presentation on theme: "Basic gvim commands."— Presentation transcript:

1 Basic gvim commands

2 How to open gvim? On command prompt type:
gvim file_name.file_extension Insert mode – i Command mode - Esc To save file first press Esc and then press ‘:w’ or ‘:w!’ to over write To exit file first press Esc and then press ‘:q’ or ‘:q!’ to quit forcefully We can combine w and q, e.g. ‘:wq’ to save and exit Exercise: Create a new file with name ‘hello_world.sv’ Press ‘i’ to go into insert mode Declare any module Save and exit the file

3 Other important gvim commands
Use Esc, * Press n to select next highlighted char Press shift + n to select prev highlighted char To highlight particular word Esc, Ctrl + v, up or down arrow to make selection, shift + I, then give required number of space, Esc Indentation Esc, :%s/char/new_char/g Replace all similar char with new char Esc, :%s/char/new_char/gc y – yes, n - no Replace all similar char with new char one by one Esc, :sp(horizontal) or :vsp(vertical) Esc, :Ex To open one more file in same window To open the current directory

4 Other important gvim commands
Use u undo Esc, <no of lines> yy (copy), p (paste), 5yy, 10p Copy and paste selected no of lines Esc, <no of lines> dd Delete the selected no of lines :tabnew New tab gg Move to start of the file Shft+g (G) Move to bottom of the file Shft+d (D) Delete line from where the pointer is /search_pattern Search any pattern in gvim

5 Recording >> qa //start recording
Pressed keys will be remembered by gvim Example of deleting ‘;’ at the end of all lines >> press key ‘End’ >> press key ‘delete’ >> press key ‘down arrow’ >> q //stop recording //repeat the recorded sequence >> // repeat the same 7 times While qa, key a was gave result, likewise many key a,b,c… recording can be done at the same time. >> qd

6 Next in Gvim – make your own ~/.gvimrc
Gvim tutor On terminal >> which gvim >> /path/gvimtutor Next in Gvim – make your own ~/.gvimrc


Download ppt "Basic gvim commands."

Similar presentations


Ads by Google