Bug 966290 - RFE: Build text-mode vim with X11 clipboard support
Summary: RFE: Build text-mode vim with X11 clipboard support
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: 18
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-22 23:55 UTC by Nan Zou
Modified: 2013-05-23 20:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-05-23 00:30:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Nan Zou 2013-05-22 23:55:18 UTC
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.

Comment 1 Karsten Hopp 2013-05-23 00:30:42 UTC
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.

Comment 2 Nan Zou 2013-05-23 20:12:30 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.