Let gVim always run a single instance

后端 未结 12 670
时光说笑
时光说笑 2020-12-12 19:14

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?

12条回答
  •  北海茫月
    2020-12-12 19:36

    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.

提交回复
热议问题