Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Textmate Navigation

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #30712
    humanshell
    Member

    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?

    #74783
    lukewilde
    Member

    Why not just use cmd+f and search for the section of css?

    #74784
    humanshell
    Member

    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.

    #74740
    TheDoc
    Member

    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.

    #74739
    humanshell
    Member

    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.

    #73109
    filipekiss
    Member

    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; :)

    #73048
    humanshell
    Member

    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. :-)

    #82684

    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.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘CSS’ is closed to new topics and replies.