History
Article Edit this page Discussion

Compress Vim doc files to save space

From Vim Tips Wiki

Jump to: navigation, search

Tip 92 Previous Next Created: July 20, 2001 Complexity: intermediate Author: Francis Version: 6.0


As everyone knows, the $VIMRUNTIME/doc is increasing rapidly in size. The directory contained so many plain-text documents that I often compress them to save my diskspace. With the support of VIM's GZIP plugin, VIM will automatically uncompress the files when we need to read them.

Here is my procedure:

1. If you have the source, go to 'runtime/doc' and edit 'doctags.c', change printf("%s\t%s\t/*", p1, argv[0]); to printf("%s\t%s.gz\t/*", p1, argv[0]); then make. This is to modify the tag, or you'll have to change the 'tags' file by hand if you don't have doctags.c.

2. Edit the new generated 'tags' file to rename 'help.txt.gz' back to 'help.txt' because it's hard-written in VIM executable binary.

:%s/help\.txt\.gz/help\.txt/g

3. Copy the new 'tags' to $VIMRNUTIME/doc and run 'gzip *.txt; gunzip help.txt'

On Vim 6.0, we can reduce the original size (3302k) to 1326k.

[edit] Comments

It is possible to compress help.txt, too. there is a 'helpfile' option in vim:

set helpfile=/usr/share/vim/vim60u/doc/help.txt.gz

Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Doctor Who
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Mystery Science Theater 3000
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"Compress Vim doc files to save space"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation