Red Hat Bugzilla – Bug 966290
RFE: Build text-mode vim with X11 clipboard support
Last modified: 2013-05-23 16:12:30 EDT
Currently there are 3 versions of vim:
/usr/bin/vi: minimal vim without many features
/usr/bin/vim: normal text version with most features
/usr/bin/gvim: GUI version
I mostly use text mode vim, however it does not have X11 clipboard support. I understand this is so the package does not have libX11 dependency. However this makes it difficult to use the X11 clipboard (I believe most people running text mode vim are running it inside a GUI terminal emulator like xterm/gnome-terminal/konsole). There's the /usr/bin/vimx which does have X11 clipboard support, but it's just a symlink to gvim, which means it's much more heavy weight than the text version (16MB memory usage versus ~4.5MB for the text version), also starts up and runs slower.
I think a valid case can be made to build a "medium weight" vim as vimx, this would be identical to the text mode vim except it has these features turned on:
+clipboard +X11 +xterm_clipboard
Memory usage and start up speed would be basically identical to the normal text mode vim and much better than gvim.
You should really try vimx. Even though it is a symlink to gvim, it uses much less memory then gvim. gvim checks at startup with which name it has been called and bypasses all the GUI stuff.
Here's some ps -aux output from the three versions:
user 20457 0.2 0.0 309608 6164 pts/0 S+ 04:10 0:00 vimx
user 20508 0.6 0.0 149172 3648 pts/0 S+ 04:11 0:00 vim
user 20526 3.0 0.2 406900 16956 ? Ssl 04:11 0:00 gvim
And for the start up speed, here are the last lines of vim --startuptime -c ":q"
vim: 022.005 000.003: editing files in windows
vimx: 025.129 000.003: editing files in windows
gvim: 139.557 000.005: editing files in windows
As you can see, vimx is exactly what you've asked for.
I appreciate the feedback. And indeed the startup time of vimx is comparable. But I disagree about the memory usage. On my 32-bit F18 system vimx process has twice the RSS versus regular vim (20 MB vs. 10 MB)
user 4007 0.0 0.9 91988 20328 pts/3 S+ 11:43 0:00 vimx file1
user 4012 0.0 0.5 21716 10516 pts/4 S+ 11:43 0:00 vim file2
RSS may not be that accurate concerning shared memory usage, but just counting the private memory usage with a tool ps_mem.py (https://raw.github.com/pixelb/scripts/master/scripts/ps_mem.py) still shows almost twice the private memory usage (13 MB vs. 7 MB).
Private + Shared = RAM used Program
7.3 MiB + 375.0 KiB = 7.6 MiB vim
13.2 MiB + 577.5 KiB = 13.8 MiB vimx
Maybe 6 MB is not something most people are concerned about. But I'd like to get the most efficient use out of my resources. I understand this may not be worth the hassle for package maintainers so I'll probably just grab the SRPM and build it myself.