Janitors Note: This was originally posted as a sourcecode node (i.e. in the Code Catacombs section). It has been moved to the CUFP section, but that had the side-effect of making the doctext too large to fit. Therefore, the code has been removed — it can be found on the external site (sourceforge) anyway, as the OP notes in the description below.


TkCodex is a specialized code VIEWER that will help you give up sliced bread. I built it for me and my_nihilist while we're learning C, so its been getting tweaked for months now and runs without errors. It works as a single script without configuration, includes a quick reference, and requires no non-standard modules.

The original idea was a read-only GUI app for scanning code when I couldn't remember the exact format of a seldom used command -- the way one might use "grep -r obscurnew()" on a tree of scripts. It also turned out to be great for development and debugging: rather than doing split screens in vim or repeated cat | less scans I now had a specific tool for highlighting all instances of a variable or function call in works-in-progress. I then intended to add a couple of sets of color to distinguish one highlight search from another. TkCodex does that, and it indexes the searches in a side panel, creating a clickable list of instances by line number. It also allows you to quickly add hypertext style notes to a piece of code. These notes and highlights can then be saved in a seperate file, without the possibility of affecting the code itself. You can remove individual or sets of highlight(s) as easily as you create them. There is a "command history" like less and vim, so you don't have to type in a previously done search.

Since TkCodex performs a unique set of functions (as far as I know), it is not based on any existing GUI interface or concept. Also, it uses key macros for speed rather than a lot of 2D mouse menus. I didn't try to include syntax highlighting.

Here's two ways to use it:


Monitored in top, TkCodex runs with with a stable residential memory size of 14 Mb.

A complete set of instructions is in the __DATA__ section of the script.

TkCodex is maintained at SourceForge: http://tkcodex.sourceforge.net/
There you may see screenshots and read the complete documentation in html.