Is there a way to combine two gvim windows into one multi-tabbed window?

I often open one file in gvim, go back to the terminal and open another file in a different directory in a new gvim instance. I wanted to know if there is an easy way to combine these two gvim instances into one window with each file in a separate tab, or if there is an easy way to open the second file in the first gvim window. I don't want to copy the path of the second file to use in the first gvim window, and I don't want to search for files in the first gvim window.

+3


source to share


4 answers


You cannot merge two windows, but you can look at the title bar of the target GVim window and use its session name in the source window:

:!gvim --servername VIM2 %

      

See :help clientserver

.




Note that Vim tab pages are not, and cannot be, proxy files.

+1


source


The workflow you describe works better with vim in a terminal, then you don't have to worry about managing multiple instances.



+1


source


Merging two separate windows is not possible. Using the Ctrl-p plugin will reduce the overhead of entering the file path as you don't want to.

Just typing <ctrl-p>

followed by a few / all the characters in the files / directory and hit <ctrl-t>

to open in tab view once you get the file you want.

+1


source


To move multiple files / tabs to another GVIM instance, I have to write a session file, exit the Vim instance, and then open the saved session in another. Cp. :help session-file

...

+1


source







All Articles