## 2011-03-18

### how-to configure textpad for ctags and findtag

The purpose of this “hack” is to provide web-like navigability to the source code, so that with Alt + right arrow and cursor positioned on an meta token instance (the instance name of function, variable, method etc. in a programming language) the cursor will jump on the definition of this meta token instance. For example in Perl if there is an object call of a method ($objectName->nameOfMethod($optionalParams) when having the cursor on “nameOfMethod” and pressing Alt + right arrow the file having the definition of this method will be opened and the cursor positioned on that very definition. Respectively with Alt + left arrow one could navigate back from the place he came from.
This functionality is provided the open source ctags.exe executable, written by Darren Hiebert, supporting 33 languages (their meta data and structure) and contained as part of many Linux distributions. The stand-alone executable should be placed in a folder of the Path environmental variable and the following commands configured:
Command name: Generate ctags database
Command: cmd.exe
Parameters: ctags.exe -R -n --fields=+i+K+S+l+m+a
Initial folder: $FileDir This command with generate the database for ctags.exe, containing all the meta names of the current code base , recursively by including selected extension fields of the code base. This command could be assigned with any shortcut in the TextPad interface (herewith Ctrl + 6 used) Command name: Jump to tag definition Command: C:\Path\to\findTag.exe Parameter: -file$AppWnd $File$Line
Initial folder: $FileDir This command could be configured with the Alt + right arrow as explained above. The command to return back to the point where this command was issued is: Command name: Tag Back Command: C:\Path\to\FindTag.exe Parameters: -back Initial folder:$FileDir
This command could be configured with the Alt + left arrow shortcut.
This configuration combined with the Textpad’ s inbuilt “find in files” feature and the “FuncJumper” introduced bellow makes the navigability of even large projects, containing 20 or more source files under different folders with approximately 100 lines per file fast and easy.