Posted by:rainman
Posted on:2003-02-05 13:43
Ctags Configuration with in UltraEdit
The Project menu allows the user to change the Ctags option and to create the tag file. The Ctags option dialog allows for the following three items to be defined:
Default Tagfile ?This specifies the tag file to be used if there is not a specific project tagfile active (defined in the project settings). This must be present if there is not a project specific tagfile for UltraEdit to lookup symbols.
CTAG EXE Path/Name ?This specifies the full path and name of the Ctag exe that will be run to create the tag file from within UltraEdit. If this is not present UltraEdit can still reference a tagfile for symbols but it can not create one. The default setting for this is "ctags.exe" in the directory containing UltraEdit.
CTAG Parameters ?This specifies the parameters to be passed to the Ctag exe for it to function correctly. The default settings are set up for "Exuberant Ctags" as described above.
%fi on the parameter line is replaced when the ctag exe is run with the filename/path of a file that contains a list of files that the ctag.exe will use to create it抯 tags from. If a project is loaded in UltraEdit, UltraEdit creates a temporary file with a list of the project files and passes this inplace of %fi.
%fo on the parameter line is replaced with the full filename/path of the tag file to becreated. This would be the tag file specified in the project, or the Default Tagfile defined above.
Creating the Tag File
The tag file can be created directly from the Project Menu with the "Create CTAG file" item, or when a project is opened the tag file can be created automatically if the project settings specify this.
Finding a Symbol/Tag
The whole purpose of Ctags is to be able to quickly find a function or object that is defined elsewhere in the file or another file. Assuming the tag file exists, selecting "Find Symbol" from the Search menu will search the tag file for the symbol and if only one match is found the file will be opened in UltraEdit and the file positioned to the symbol. If multiple matches occur, a dialog box will be shown giving the user the option to position to the appropriate tag.
先到 http://ctags.sourceforge.net/ 下载ctags软件包,把ctags.exe放到ultraedit的安装目录下。然后建立一个project,并选择好一个ctag文件。
然后可以在命令行窗口中用ctags命令来生成ctag索引,参数如下:
E:\Temp\test>e:\tools\UltraEdit\ctags.exe -f testtag.txt --language-force=java -R . 其他参数可以参考帮助ctags.exe --help。
然后在ultraedit中就可以选中某个类名或变量名,方法名后,按F11跳出相关代码。如下图所示。