Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to open a file in a new tab in an already running console Vim session. This functionality is available in gVim via the --remote-tab-silent option. If this is not possible, I was wondering if there is a work around.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

If you have Vim compiled with +clientserver, and you run Cygwin's X server, and you invoke console Vim with a --servername argument, then yes. See:

:help clientserver
:help --servername

Example:

vim --servername vim
vim --remote-tab-silent foo

When you install Cygwin's version of gVim, it should create a symbolic link from /bin/vim to /usr/bin/gvim, which means you will have +clientserver and you can use this functionality in console vim.

The reason the X server is required is that "Unix" variants of Vim use X's security protocols and interprocess communication to implement the +clientserver features. The question is whether you want to have to run Cygwin's X server just to get this functionality.

share|improve this answer
1  
Incidentally, I prefer to start Cygwin's X server with the -internalwm argument, which prevents X from running in a window where X clients display; instead, the X clients are handled by Windows' directly. –  Heptite Aug 11 '12 at 20:47
    
Thank you for your answer. I am curious how you figured this one out? –  Forethinker Aug 12 '12 at 5:51
1  
It's not a simple explanation, but part of it is that I follow the Vim developers' mailing list, so I was aware that console Vim could become a server provided an X server was available and the --servername argument was provided on invocation. It wasn't a stretch to assume that it'd basically be the same under Cygwin as long as Cygwin's X server was available. –  Heptite Aug 12 '12 at 5:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.