开发者

Is there any way of compressing the tagfile in vim

I was following the guide at teuton.blogspot.com to set up autocompletio开发者_开发百科n, when I ran the command:

ctags –R --c++-kinds=+p --fields=+iaS --extra=+q \
    -f ~/.vim/commontags /usr/include

to generate a tagfile, only to realise that the command would generate a 'commontags'-file of 1.5GB – a bit larger, than I'd have liked it to be, no doubt. So I was wondering is there some way of compressing the file and have vim still recognize it?

I tried running it through gzip, which churned it down to 25MB, but I've had no luck getting vim to use that file instead.

Any ideas? I'd be grateful!

/B2S


Using --excmd=number should cut the file size down by around 50% because ctags will only store line numbers of matches instead of a search pattern. This should be fine if the files in /usr/include don't change very often.


Even if you could compress the tags file vim would still have the overhead of uncompressing it for searches.

Your best bet is excluding what you don't need. Most of the /usr/include/ are probably dev files you needed to install source packages.

You're better off creating a tags file relevant to your development projects. Basically opt in to a directory when you file you cant tag jump to it. Rather than build an enormous list of irrelevant tags. Even if your machine is fast enough to process it you will still have to deal with duplicate names.

If you want to suck in everything you might be able to use --exclude to chop it down to a manageable size. ie. a blacklist rather than a white list approach.

man ctags
/--exclude <-- to search for exclude 

I'd personally do something like

`ctags –R --c++-kinds=+p --fields=+iaS --extra=+q \
-f ~/.vim/commontags /usr/include/lib_i_need_a /usr/include/lib_i_need_b `
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜