4 ms·
I don't see a point to this. Textmate can collapse all of the blocks, so you get the same effect, without losing the readability if you want it. Also, who vis
by oomkiller 16y ago
I don't see a point to this. Textmate can collapse all of the blocks, so you get the same effect, without losing the readability if you want it. Also, who visually searches a css file? I just use CTRL-S in Textmate or Emacs.
- earnubs 16y agoMakes it easier to sort in Vim; 'ggVG!sort' will sort your css alphabetically: .bar .apple {...} .foo .apple {...} .foo .banana {...} .foo .cherry {...} (I also have a wee script that sorts the declarations alphabetically too.) I prefer the style, I find it much easier to write, edit and maintain.
- mattwdelong 16y agoWould you mind sharing this script with HN'ers?
- earnubs 16y ago#!/usr/bin/perl -w use strict; # from selected block in vim: !scriptname.pl while (defined(my $line = <STDIN>)) { $line =~ m/^(.*)\{(.*)\}/; my $element = $1; my @list = split /;/, $2; @list = join ';', sort { $a cmp $b } @list; print STDOUT "$element" . "{@list}\n"; }