Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two vim windows but one instance?

Tags:

vim

I want to have "two vim open" because I have multiple monitors. Also I would like them to share buffers, clipboards, etc. So I'd like to share the same instance across two different windows.

I have found:

vim --remote file.txt

but this opens the file in the first vim; it doesn't open a new window within the same vim instance.

How can multiple vim windows share the same instance?

like image 318
Fractale Avatar asked Oct 30 '22 10:10

Fractale


1 Answers

Although I don't believe there is a native way this can be achieved in VIM, there are however other ways to get similar behavior :

  1. Expand your terminal to be available on both monitors, that way you can use vim splits and have one split in each monitor and hence work on the same file in both monitors. Although this is probably less cool.
  2. Use something like tmux / screen. This way you can just launch multiple terminal windows and have them in separate monitors and connect to the same tmux session from both. You can then edit / view your vim session in either monitor and it will be perfectly mirrored in the other.
like image 86
Dhruva Sagar Avatar answered Dec 09 '22 05:12

Dhruva Sagar