Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Let gVim always run a single instance

Is there a way to let gVim only run a single instance, so that when a new file is opened with it it's automatically opened in a new tab in the currently running instance?

I know you can do that by passing --remote-tab-silent but I want to configure gvim so that this becomes the default behavior. i.e. I want to type gvim filename and make it act as if I passed the --remote-tab-silent option to it.

gVim 7.2

Edit

I'm on windows (vista)

like image 481
hasen Avatar asked Jun 01 '09 20:06

hasen


1 Answers

If you are using the bash shell (on Linux/OS X/using Cygwin) is to add you ~/.bashrc file:

gvim () { command gvim --remote-silent "$@" || command gvim "$@"; } 

On Windows I think you could have a gvim.bat batch-script to achieve the same..

gvim.exe -p --remote-tab-silent %1 %* 

If gvim.exe isn't in your path

Run > Search "Environment" 

Edit PATH var for current user or system.

like image 108
dbr Avatar answered Sep 21 '22 13:09

dbr