14.06.2014 Views

vim 101 hacks

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Buyer: xiujuan lu (luxiujuan@gmail.com)<br />

Transaction ID: 85W16630AD8515549<br />

Vim <strong>101</strong> Hacks<br />

www.thegeekstuff.com<br />

Hack 18. Navigate any Source Code effectively using<br />

Ctags<br />

Install ctags package<br />

# apt-get install exuberant-ctags<br />

(or)<br />

# rpm -ivh ctags-5.5.4-1.i386.rpm<br />

warning: ctags-5.5.4-1.i386.rpm: V3 DSA signature:<br />

NOKEY, key ID db42a60e<br />

Preparing...<br />

########################################### [100%]<br />

1:ctags<br />

########################################### [100%]<br />

Generating ctags on your source code<br />

Go to the directory where your source code is located. In the example below,<br />

I have stored all my C programming source code under ~/src directory.<br />

# cd ~/src<br />

# ctags *.c<br />

The ctags command will create a file named tags that will contain<br />

information (tags) about the *.c program files. The following is partial<br />

content from a ctags file.<br />

# cat tags<br />

AddAcl dumputils.c<br />

/^AddAcl(PQExpBuffer aclbuf,<br />

41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!