Hi Here some very much useful commands are given for programmers who use gvim/vim as their editor.
Lets assume that compiler is giving error in file
/home/sandipb/temp/system_verilog.sv : Undefined Veriable
As you are using powerful gvim/vim software just put your cursor to that directory path which is shown in blue color in this post(you will have your own path in your log) and press "fg" and you are in the /home/sandipb/temp/system_verilog.sv
:bd
This the command for going back to directory.
Spliting file Vertically as well as Horizontally
You can easily split your vim/gvim window using split commands. To split your gvim window use split command.
:split
And to split your gvim window vertically use vsplit command.
:vsplit
In some cases where you want to directly open specific file in split mode. In this case simply give file path name as argument of split / vsplit command.
For example you want to open file ~/abc/xyz.txt in new splited window.
User command :split ~/abc/xyz.txt or :split ~/abc/xyz.txt
Open or reload file in gvim/vim
Generally we use tabnew to open a file when we want new file to be opened in new tab and current working file remain open.
To open a new file without giving path. You can use :e filename command for this.
To reload the file just write :e
Auto word or line completion in gvim/vim
Programmers always need to define variables and need to use them. One basic requirement for using variable is that name should be same at all places !!!!!! For this thing gvim provides facility to auto complete you variable name.
Cntl + p & cntl + n used to auto complete the word. There is not much difference using cntl + p or cntl + n.
cntl + p auto complete the word in previous direction.
cntl + n auto complete the word in next direction.
Same way we have one auto complete command for completing lines.
That is cntl + l this command auto complete the line.
These are the tricks to work faster that I am able to learn in my 2 and half year of experience.
Previous Index
Going Forward in file
Suppose you are seeing log of some code that you have written in some programming language. As I am ASIC engineer lets say System Verilog. Now in your log file there is some compilation error in some particular file which is shown with full path in log. right??Lets assume that compiler is giving error in file
/home/sandipb/temp/system_verilog.sv : Undefined Veriable
As you are using powerful gvim/vim software just put your cursor to that directory path which is shown in blue color in this post(you will have your own path in your log) and press "fg" and you are in the /home/sandipb/temp/system_verilog.sv
Back to Directory
Now after doing some necessary changes in the edited file you can go back to log file by simply typing the following command.:bd
This the command for going back to directory.
Spliting file Vertically as well as Horizontally
You can easily split your vim/gvim window using split commands. To split your gvim window use split command.
:split
And to split your gvim window vertically use vsplit command.
:vsplit
In some cases where you want to directly open specific file in split mode. In this case simply give file path name as argument of split / vsplit command.
For example you want to open file ~/abc/xyz.txt in new splited window.
User command :split ~/abc/xyz.txt or :split ~/abc/xyz.txt
Open or reload file in gvim/vim
Generally we use tabnew to open a file when we want new file to be opened in new tab and current working file remain open.
To open a new file without giving path. You can use :e filename command for this.
To reload the file just write :e
Auto word or line completion in gvim/vim
Programmers always need to define variables and need to use them. One basic requirement for using variable is that name should be same at all places !!!!!! For this thing gvim provides facility to auto complete you variable name.
Cntl + p & cntl + n used to auto complete the word. There is not much difference using cntl + p or cntl + n.
cntl + p auto complete the word in previous direction.
cntl + n auto complete the word in next direction.
Same way we have one auto complete command for completing lines.
That is cntl + l this command auto complete the line.
These are the tricks to work faster that I am able to learn in my 2 and half year of experience.
Previous Index