If you're using Sublime Text 2, you might have switch to it because it's Find in Project is super fast and nice. And if you're using Sublime Text 2, that means you're working locally on files, meaning there is a good chance you're using CSS preprocessors. If you're using CSS preprocessors, you probably compile CSS into a compressed style (non-relevant whitespace stripped) because that's best, speed wise, for live websites.
Now let's say you use Find in Project to find a class definition (e.g. ".sidebar-poll") that you need to edit. You'll probably find the .scss file or .less file or whatever, but you'll also find it in the compressed CSS, which is this giant one-line file and totally borks up your Find Results page.
Yeah, I don't really need to see that.
We can't blame Sublime Text 2 because 1) It's finding what you told it to find and 2) They provide a way to fix this if you don't want to see those Find results. To fix this:
1. Save your project
Open your project (drag folder of project onto Sublime Text 2 icon in dock). Then save it from the Project menu.
This is nice anyway, since you get a file (YOUR-PROJECT.sublime-project) that you can double-click to open it back to the state you left it in at any time.
2. Edit Project
Go to Project > Edit Project.
3. Add Exclude Pattern
Alter the JSON there include the folder_exclude-patterns of the folder where you keep your compressed CSS:
{
"folders":
[
{
"path": "/Users/chriscoyier/GitHub/whatever/",
"folder_exclude_patterns": ["css"]
}
]
}
Now that folder won't show up in the sidebar of your project, nor in the search results. Huzzah!
Note
This is for excluding folders on a per-project basis. If you always want to exclude a particular folder, you can change this exact same setting in Sublime Text 2 > Preferences > Settings - Default (or User).
Exclude Compressed CSS from Sublime Text 2 Projects is a post from CSS-Tricks
via CSS-Tricks http://css-tricks.com/exclude-compiled-css-from-sublime-text-2-projects/
Comentaris
Publica un comentari a l'entrada