- This topic is empty.
November 17, 2010 at 5:47 am #30712
I have a quick TextMate question about navigating through a long CSS file.
A while back I decided to learn a little Objective-C (since abandoned) and I really liked the ability to navigate inside of the Xcode editor using #pragma marks. It really helped getting to the section of code you were looking for faster than constantly scrolling up and down to find the method or variables you needed access to.
So my question is, are there #pragma marks in CSS, is there a way to implement this in TextMate or Coda?November 17, 2010 at 8:01 am #74783lukewildeMember
Why not just use cmd+f and search for the section of css?November 17, 2010 at 8:25 am #74784
I have no problem searching for different sections. I just thought that if someone knew how to add in a kind of #pragma that it could make it easier to jump to a specific section using the pop-up menu at the bottom of the TextMate window.
I’m still a little new to CSS and I’ve gotten so much help from CSS-Tricks that I figured there might be someone here who knew of a way to jump to a specific section rather than searching for a specific entry to jump to.
It’s not a huge deal if it’s not possible. I just searched around a little and didn’t find anything so I thought I’d ask. It’s really just my own lazy-ness. :-)
Thanks for the quick reply.November 17, 2010 at 9:23 pm #74740TheDocMember
I usually have a ‘Table of Contents’ of sorts at the beginning of my CSS file. It says something like, “The following sections are flagged with a ‘='”.
Then before each major section throughout the code I will put:
/* = SECTION NAME */
Then I can just go Ctrl-F ‘=’ and just keep on hitting enter until I hit the section I’m looking for.November 17, 2010 at 10:44 pm #74739
Hey! I never thought of that. Search for something that doesn’t show up anywhere else but in your comment “sections”. I like that, thanks.June 13, 2011 at 5:02 pm #73109filipekissMember
Hey, sorry to bring up this topic, I know it’s kinda old, but you should try to combine the flags TheDoc suggested above with the TextMate ⌘⇧T (Cmd+Shift+T) tool to search within the code. This way, you can either search for the flags or the actual css rule; :)June 13, 2011 at 8:07 pm #73048
Well it’s been 7 months since I started this thread and I’ve gotten a lot better at HTML/CSS and WordPress. I’ve also come a long way with TextMate. I’ve been doing what TheDoc suggested. After a while it becomes habit and you don’t even realize that you’re searching. It becomes part of the workflow. However, I did not know about cmd+shift+T. I really like that! Gonna start using it a lot. I’ve also recently started using ctrl+esc for faster access to bundle functions that I haven’t memorized the shortcuts for. Another nice one that I’m trying to get into the habit of using is ctrl+cmd+T for searching available bundles within your scope.
I appreciate the reply even this late. :-)June 30, 2011 at 1:31 pm #82684nyc_css_coderMember
You can definitely add references that act like pragma marks. Simply start your CSS comment with a slash and double asterisks. For example:
/** main styles
Then you should immediately see the line appear in the symbol popup list.
Command-shift-T is useful, but there’s not substitute for adding your own code references.
As far as jumping around using the Find feature… obviously not a method for coding efficiently. You were on to the right idea from the start, pragma marks (or pragma-like marks) are the way to go.
- The forum ‘CSS’ is closed to new topics and replies.