How to install light-weight vim and to be able to efficiently load files into one instance vim

command lineconsoleeditorsefficiencyvim

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:

The communication between client and server goes through the X server. The display of the Vim server must be specified. The usual protection of the X server is used, you must be able to open a window on the X server for the communication to work.

[...]

A non GUI Vim with access to the X11 display (xterm-clipboard enabled), can also act as a command server if a server name is explicitly given with the --servername argument.

This mailing list post is clearer on what is needed:

Except on Windows, communication between server and client goes through X11, so in that case you need both the --with-x configuration option (or default) at compile-time (which, in turn, requires one or more X11 "development" packages to be installed) and an available X server at run-time.

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 building vim yourself (e.g. by rebuilding the Debian package (packaging tutorial PDF)) such that while still needing X11, you could do without GTK etc.

Related Question