Working with vim on multiple monitors

codeape picture codeape · Oct 22, 2010 · Viewed 9k times · Source

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.

Answer

codeape picture codeape · Oct 28, 2010

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.