Sunday, July 27, 2014

Cool things to learn about gvim

Change gvim/vim directory in that file is in. 

This is very useful thing when you are working in project which contains very large number of directory. In this case sometimes when you use tabnew command directory in which newtab is opened is the directory at which you previously run gvim command on terminal. Let's take an example,

Suppose you have written following command to open file.
You are in current directory asdfg
  gvim a/b/c/d/e/f.txt

Now in gvim tabnew command which will open new tab which will have current directory asdfg and you have to again write whole path a/b/c/d/e and then you will be able to open your file.

Now what if your tabnew command considers your current directory as instead of asdfg ?? 
Wont it will be cool thing ??
You can do this using command :cd %:p:h 
 Whole procedure is like this :
  write :cd %:p:h and then tabnew ./ your current directory is now.You are done !!!!!



Previous                                Index