Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

ctags: Difference between revisions

From MoodleDocs
No edit summary
 
Line 17: Line 17:
* To open in a new editor window type the command ''':stag <tagname>'''
* To open in a new editor window type the command ''':stag <tagname>'''
* To return to your previous location type '''CTRL+t'''
* To return to your previous location type '''CTRL+t'''
==See Also==
[[http://www.vim.org/tips/tip.php?tip_id=94 Vim tags usage tip]]
{{stub}}

Revision as of 08:19, 27 March 2007

The root directory of the Moodle CVS distribution contains a file called tags. This contains information about the location of symbols throughout the moodle code. An editor can make use of this to automatically jump to the place where a function is defined.

Using tags with Vim

In order to use the tags file with the Vim editor (on a Unix style system), you should first add the following line to the file .vimrc in your home directory:

   set tags = tags;/

If .vimrc does not exist you should create it. This directive will force Vim to search for the tags file in the directory tree in which you are working (it searched up from where you are) so it will work for multiple versions of the code automatically.

How to jump to a tag with Vim

There are a number of things you can do:

  • Place the cursor over the tag (e.g., function name) and press CTRL+]
  • Type the command :tag <tagname>
  • To open in a new editor window type the command :stag <tagname>
  • To return to your previous location type CTRL+t

See Also

[Vim tags usage tip]