User login

CTags and Vim

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

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.