Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working with vim on multiple monitors

Tags:

vim

gnu-screen

I have three monitors.

I normally run one maximized xterm on each monitor, attached to the same GNU screen session.

Can a similar model be used for vim? Is it possible to have three vims running, all sharing the same "vim session":

  • Each vim window showing a different vim tab
  • vim settings shared between all windows
  • Not getting the "Swap file ... already exists!" error message if I open the same file on two tabs.
like image 402
codeape Avatar asked Oct 22 '10 09:10

codeape


People also ask

Can a Raspberry Pi run multiple monitors?

If you have a Raspberry Pi 4 or Pi 400, you may well have noticed that it features not one but two micro-HDMI video output ports. With a couple of suitable cables, this means that you can hook your Raspberry Pi up to a dual monitor setup.

How do I use two monitors with VMware?

To enable the multiple-monitor feature, click the Settings toolbar button in the upper-right corner of the desktop and application selector window, turn on the Use Multi Monitors if there are two monitors option in the Settings window, and click Close.

How do I run multiple monitors on a virtual machine?

There's no way to have a separate window on the host for each guest monitor, but you can have one large host window with multiple monitors in the guest. With the VM powered off, go to VM > Settings > Hardware > Display. Select "Specify monitor settings", and set "Number of monitors" to 2 or more.

Does Ubuntu work with multiple monitors?

We can set up dual monitors in both Windows and Linux. Here I will provide you the procedure on how to set up a dual monitor on Ubuntu (Linux). Two approaches are provided below to setup a dual monitor on Ubuntu, you can choose the one you find convenient for you.


2 Answers

I have a working solution where two vim instances communicate.

http://github.com/codeape2/vim-multiple-monitors

It uses the SwapExists autocmd to instruct the other instance to open a file if an existing swap file is detected.

like image 55
codeape Avatar answered Sep 28 '22 09:09

codeape


You can use vim under screen.

$ screen $ vim  # on another terminal  $ screen -x # the same vim screen 

If your terminal emulator supports tabbing (e.g. gnome-terminal), you can use it as a tabbing (IMHO, gnome-terminals' tabbing support is better than vim's own, except perhaps you can't copy and paste among different vim sessions, however you can instead use the system copy-paste buffer: "+y and "+p).

This does not work if you're using gvim though.

like image 30
Lie Ryan Avatar answered Sep 28 '22 10:09

Lie Ryan