[clug] BUFSIZ - how do you look it up?
Jeremy Kerr
jk at ozlabs.org
Sun Jan 13 21:11:12 MST 2013
Hi Hal,
> Ok so I can write a one line C program like you can. But surely I'm missing
> something and you can look up defined constants in man pages?
>
> How are you guys doing it?
Rather than looking for the content in man pages, I tend to go directly
to the source. Using ctags will help with this:
ctags -R -f ~/.vim/systags /usr/include
This builds an index of the macros, variables and functions defined in
the headers under /usr/include. The index is placed in ~/.vim/systags.
then, configure vim to use this file as the "system tags". In .vimrc:
set tags+=~/.vim/systags
Then you can use vim's tag support to go to specific C identifiers. Either:
:ta BUFSIZ
or:
with the cursor over an identifier, hit ctrl + [
or:
ctrl + click on an identifier
or, to open vim and go directly to that tag:
vim -t BUFSIZ
While this is vim-specific, there'll likely be an equivalent for your
editor of choice.
Cheers,
Jeremy
More information about the linux
mailing list