linux - How can I run ctags in a large code base? -


assuming have code directory structure follows:

/top      /second          /core              a.pl              b.pl              c.pl          /common              d.pl              e.pl          /util              f.pl              g.pl              h.pl     

where should run ctags can jump function definitions via vi?

for example had:

/dir    /perl         a.pl   

and run in dir command ctags -r perl in a.pl not jump function definition existed in same file.
if did ctags -r . inside perl directory worked.

so can not understand pattern. should run ctags in core, common,util? if code base huge? need run in each directory?

normally use 1 tags file located in root directory of project.

for example, tag whole of vim's own source code, located in ~/src/vim-7.3, navigate directory , generate tags file there.

$ cd ~/src/vim-7.3 $ ctags -r 

that's all.

you can same inside vim, of course. start vim , type:

:cd ~/src/vim-7.3 :!ctags -r 

check have correct 'tags' setting. default ./tags,tags, meaning vim tags file in current directory.

make sure read :h 'tags' in entirety. can instruct vim tags files deep in directory tree giving patterns containing wildcards.

one more thing: approach work, vim's current working directory must remain @ root @ times. if have option 'autochdir' set or switch directories yourself, tags won't found.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -