Home ›
CTags and Vim CTags and Vim
Submitted by Benjamin Melançon on July 3, 2011 - 8:22am
Thanks in part to
http://sachachua.com/blog/2008/07/eclipse-to-emacs-navigating-your-source-tree/
Set-up:
(If not already installed: sudo apt-get install exuberant-ctags
)
ctags -R -f ctagstags --languages=php --langmap=php:.module.php.inc.engine.profile .
In .vimrc,
set tags=ctagstags;/
In .bashrc
# Alias for creating CTags file, to run from the base of your Drupal project alias dtags='ctags -R -f ctagstags --languages=php --langmap=php:.module.php.inc.engine.profile .'
To find the definition of the function, you put your cursor on the function name and press ctrl+]
Or, when in vi, you can type the name:
:ta name_of_function
To go back to the file you were just in:
ctrl + o
When on the command line, you can open the file and jump to the function declaration in Vim with:
vi -t name_of_function
To rebuild your tag index, go to the root directory of your project and use the alias:
dtags
For other Bash and Git improvements
see /etc/bash_completion.d/git
Searched words:
ctag
original function body declaration
Comments
Post new comment