On my laptop with Ubuntu I'm able to have just one instance of vim, launched with
vim --servername VIM
After this I'm able to open files from console with
vim --remote-silent filename
I use short aliases for both of them.
Also I do some computation on another computer (I'll call it workhorse). It has Debian x64 (without gui) installed. I usually access it using multiple instances of Putty from a Windows PC. Actually workhorse is a virtual machine and I pay for resource usage, so I don't want to overload it too much. However after usual installation of vim (apt-get install vim
) I'm unable to run vim with –servername option. It says
Unknown option argument: "--servername"
More info with: vim -h
Indeed, documentation says that vim should be compiled with +client-server option to run it as "a command server". I know two other options: apt-get install vim-gtk
and apt-get install vim-gnome
, but they ask for huge installation (136Mb and 245Mb respectively). As far as I understand this is somehow related with installation of graphical interface.
I don't have any preferences for any particular workaround. Probably, I will be happy with any workable solution. But I do want to load files to vim from console, like I'm doing it from Ubuntu, or otherwise I do want to know any other way to effectively use vim for editing multiple files. So the question remains
How to install light-weight vim and to be able to efficiently load files into one instance vim?
Best Answer
The client-server capabilities of
vim
depend on X11, citing from its help:This mailing list post is clearer on what is needed:
Thus, if you're concerned with resources on your "workhorse", it might be better to just fire up
vim
instances when needed.Edit: You could get away with "less than
gvim
" by buildingvim
yourself (e.g. by rebuilding the Debian package (packaging tutorial PDF)) such that while still needing X11, you could do without GTK etc.