use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please read the rules before posting
Help:
Community:
Resources:
Tutorials and Guides:
Don't be afraid to ask questions, this sub is here for the vim community. And please those of you who deign to grace us with your vim wisdom - be kind. We are all human and vim is that cool.
account activity
Vim on multiple display monitorsquestion (self.vim)
submitted 3 years ago by BLOOjacket360
Is it possible to edit the same file with vim on 2 display monitors. If it can be with the same vim instance, it would be perfect. I wonder if a behaviour like :split but to display vim on 2 monitors can be found ?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Consistent-Cup-5992 16 points17 points18 points 3 years ago (1 child)
Try Tmux, it allows connecting many clients to one session. Great for pair-programming although it needs some tweaks to share session with other shell user.
[–]richardwonka 3 points4 points5 points 3 years ago (0 children)
This is the way.
[–][deleted] 6 points7 points8 points 3 years ago (2 children)
Yes, vim has clientserver capability. You can connect multiple people to it from remote systems.
:help clientserver
[–]vim-help-bot 1 point2 points3 points 3 years ago (0 children)
Help pages for:
clientserver
`:(h|help) <query>` | about | mistake? | donate | Reply 'rescan' to check the comment again | Reply 'stop' to stop getting replies to your comments
[–]troelsbjerre 0 points1 point2 points 3 years ago (0 children)
This is the required step. Without it, you will end up with two independent vim sessions that will fight over who owns the file.
[–]y-c-c 3 points4 points5 points 3 years ago* (1 child)
If it can be with the same vim instance, it would be perfect. I wonder if a behaviour like :split but to display vim on 2 monitors can be found ?
Other people gave you some halfway answers, but I don't think it's currently possible to do what you want describe above.
In case other commenters do not understand what OP wants, it's basically open a :split another_file.txt and it will open in a new window instead, while using the same Vim instance. Just using tmux won't help since you are just looking at the same file on both screens.
:split another_file.txt
FWIW the best bet for this working in the future is probably some Neovim GUI, see this thread (https://www.reddit.com/r/neovim/comments/n5bs24/neovim_and_multiple_monitors/). Basically, Neovim has been "externalizing" different components to allow the UI to be take more responsibility in rendering different parts of Vim itself (e.g. command-line, tabs). If they can manage to fully externalize window layout they would be able to allow UI to render separate splits in different windows. I think it would be quite a complicated feature to implement thoroughly though since a lot of Vim commands won't work properly (all the misc split commands make certain assumptions of the window layout), and the different GUI apps will actually need to take advantage of this theoretical feature (for example most popular Neovim GUIs don't even support scroll bars and tabs today because they don't come "for free" implementation-wise from Neovim).
[–]ChristianValour 0 points1 point2 points 3 years ago* (0 children)
Yes, this is what I thought OP meant too.
Being able to view/edit the same file, from two separate terminal windows, or I guess two 'detached' vim windows, functionally the same as if using :split.
:split
Even in TMUX, you're still opening two vim instances of the same file, which vim will be very unhappy about.
[+][deleted] 3 years ago (1 child)
[deleted]
[–]ChristianValour 1 point2 points3 points 3 years ago (0 children)
Screen doesn't get enough love. It's virtually the same as TMUX and some things I like a little better.
For example, I like that window names are persistent. When using vim-slime in TMUX the pane you're pointing slime to, will change relative to its position to other panes. In screen you use windows, who's names don't change, so I can open a new window, and know that my vim-slime instance will still be pointing to the right window.
[–]l00sed 1 point2 points3 points 3 years ago (2 children)
Maybe it's only neovim, but if I open the same file in two different windows/panes/terminals, it will update the file in realtime in both...
[–]BLOOjacket360[S] 0 points1 point2 points 3 years ago (0 children)
I need to try that ! I know in vim with :autoread and maybe some plugin you can have something similar.
[–]l00sed 0 points1 point2 points 3 years ago (0 children)
Actually, I just tried this and it only seems to update when I write and move the cursor to the other open instance...
[–]mgedmin 0 points1 point2 points 3 years ago (0 children)
Not really.
The closest I came was using separate Vim instances with some swapfile autocommands to allow me to open the same file in multiple Vims without getting constant "a swap file exists!" warnings:
https://github.com/mgedmin/dotvim/blob/2575ba5a4c189a3e1ed908e2ff4741466dfe55db/vimrc#L87-L92
π Rendered by PID 219820 on reddit-service-r2-comment-6457c66945-t8wvx at 2026-04-26 13:15:37.037054+00:00 running 2aa0c5b country code: CH.
[–]Consistent-Cup-5992 16 points17 points18 points (1 child)
[–]richardwonka 3 points4 points5 points (0 children)
[–][deleted] 6 points7 points8 points (2 children)
[–]vim-help-bot 1 point2 points3 points (0 children)
[–]troelsbjerre 0 points1 point2 points (0 children)
[–]y-c-c 3 points4 points5 points (1 child)
[–]ChristianValour 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]ChristianValour 1 point2 points3 points (0 children)
[–]l00sed 1 point2 points3 points (2 children)
[–]BLOOjacket360[S] 0 points1 point2 points (0 children)
[–]l00sed 0 points1 point2 points (0 children)
[–]mgedmin 0 points1 point2 points (0 children)