Version 1.03 of TmCodeBrowser is available now at
http://www.cocoabits.com/TmCodeBrowser/
NOTE: I have changed the handling of .ctags.tmcodebrowser: If ~/.ctags.tmcodebrowser does not exist, fall back to internal default. That way users without a customized ~/.ctags.tmcodebrowser will benefit from updates to the internal default file.
So unless you have personal customizations not covered by the default file, please delete your ~/.ctags.tmcodebrowser, for example by entering this line in a terminal window:
rm ~/.ctags.tmcodebrowser
Gerd
Change Log
Version 1.03:
- Possible freeze while moving the selection, fixed
- Added some quotes in Objc-C postprocessing script to avoid problems with spaces in paths
- Added line for HTML <div> sections to the default .ctags.tmcodebrowser
- Changed handling of .ctags.tmcodebrowser: If ~/.ctags.tmcodebrowser does not exist, fall back to internal default. That way users without a customized ~/.ctags.tmcodebrowser will benefit from updates to the internal default file
- Changed CFBundleVersion to a growing integer in preparation for automatic version checks by TextMate
- Fixed tabbing through the CodeBrowser panel
- Added line for HTML <div> sections to the default .ctags.tmcodebrowser
First off, thank you very much for this plugin. I don't understand much about ctags, and I don't see any of my <div>s showing up yet, but that's cool.
One thing I'd really like to see is the addition of IDs. I use the ID attribute like crazy, it's how I style elements with CSS and access them through the DOM. In fact, I'm at the point where without even thinking about it I just label almost every list, div, or header tag with some semantic ID just in case I want to access it later through either javascript or CSS. This comes in handy when working on certain sections of the site, because most modern browsers let you use put the ID of any element in the URL as a target.
So, in my dream version of TmCodeBrowser, it would list all of my IDed tags like:
div#header h1#h-title div#toolbar div#content ul#top-ten div#footer span#copy
Something like that perhaps? Is this possible with ctags? Could someone give me a pointer on how to configure this?
On Nov 5, 2005, at 5:32 PM, Scott McDowell wrote:
- Added line for HTML <div> sections to the
default .ctags.tmcodebrowser
First off, thank you very much for this plugin. I don't understand much about ctags, and I don't see any of my <div>s showing up yet, but that's cool.
Actually, I just downloaded the latest version, and I don't see anything for divs either. It seems to catch only a's, h's and img's.
So, in my dream version of TmCodeBrowser, it would list all of my IDed tags like:
Something like that perhaps? Is this possible with ctags? Could someone give me a pointer on how to configure this?
I am not quite familiar with the ctags syntax, but it seems pretty simple. From a terminal, in your home directory, just type: "mate .ctags.tmcodebrowser, and scroll down to the html section. Add the following line: --regex-html=/<div[ \t]+id[ \t]*=[ \t]*"([^"]+)/\1/Divs/i You could instead use: --regex-html=/<div[ \t]+id[ \t]*=[ \t]*"([^"]+)/div#\1/Divs/i If you want the thing to appear to be div#the-id instead of just the-id. If instead you use: --regex-html=/<([a-zA-Z]*)[ \t]+id[ \t]*=[ \t]*"([^"]+)/\1#\2/Ids/i Then this will (hopefully) catch all tags whose first attribute is id, i.e if you have: <hey id="there" It will show in the codebrowser: hey#there. I haven't tested this much, so maybe some else can fine-tune it. In any case, I hope it will get you started.
Basically you can pretty much have ctags do whatever you want it to. You just specify a line like: --regex-language=/regexp/name/category/i where language is the language you want this to work in, regexp is a regular expression to be matched, name is the thing you want to appear is codebrowser, where you can use \1,\2,\3,.. for the groups matched in the regular expression, and category is the general header under which you want those to appear. not sure what the /i is supposed to do, and what other things you could use instead. This document: http://ctags.sourceforge.net/ctags.html, specifically the "TAG FILE FORMAT" section, is supposed to explain how this syntax works, though I find it a bit lacking in examples. But you'll find lots of examples in .ctags.tmcodebrowser.
Haris
Charilaos Skiadas <cskiadas@...> writes:
On Nov 5, 2005, at 5:32 PM, Scott McDowell wrote:
From a terminal, in your home directory, just type: "mate .ctags.tmcodebrowser, and scroll down to the html section. Add the following line: --regex-html=/<([a-zA-Z]*)[ \t]+id[ \t]*=[ \t]*"([^"]+)/\1#\2/Ids/i Then this will (hopefully) catch all tags whose first attribute is id, i.e if you have:
Thanks so much for this tip. Your code seems to be working, but unfortunately most of my tags don't always place ID as the first attribute. It looks like anchor tags and image tags are done the same way (ie: an img tag requires the first attribute to be 'src' to show up). This gets complicates thins if I have an image with an ID.
For example:
<a href="url" id="mylink" />
The tag above shows up under images, but not IDs.
<a id="mylink" href="url" />
The tag above shows up under IDs, but not under anchor tags.
I'm not really so good with regex. This command:
--regex-html=/<([a-zA-Z]*)[ \t].*+id[ \t]*=[ \t]*"([^"]+)/\1#\2/Ids/i
I'll see if I can't figure something out better, but it seems that whatever fix I come up with should probably be applied to both anchor and image tags as well.
----Scott
On Nov 5, 2005, at 11:09 PM, Scott McDowell wrote:
I'll see if I can't figure something out better, but it seems that whatever fix I come up with should probably be applied to both anchor and image tags as well.
Try: --regex-html=/<([a-zA-Z]*)[ \t]+([a-zA-Z]+[ \t]*=[ \t]*"[^"]+"[ \t] *)*id[ \t]*=[ \t]*"([^"]+)/\1#\3/Ids/i
----Scott
Haris
On 05/11/2005, at 21.00, Gerd Knops wrote:
Version 1.03 of TmCodeBrowser is available now at
It seems the version online is still 1.02.
On Nov 5, 2005, at 22:35, Allan Odgaard wrote:
On 05/11/2005, at 21.00, Gerd Knops wrote:
Version 1.03 of TmCodeBrowser is available now at
It seems the version online is still 1.02.
^$#^##$@@!!! Fixed.
Gerd
DO! ... I should possibly read my ENTIRE new e-mail before sending anything. Sorry about my first letter *blushes*
Andreas