Fractale
Fractale

Reputation: 1644

Two vim windows but one instance?

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?

Upvotes: 7

Views: 1327

Answers (1)

Dhruva Sagar
Dhruva Sagar

Reputation: 7307

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.

Upvotes: 1

Related Questions