Live data from Hacker News

My intro to LESS - If you're not using it, you should be.

austinkpickett.com

11–20 of 44 posts

Re: My intro to LESS - If you're not using it, you should be.

#15
I just started using LESS and if you're on a Mac, I highly recommend LESS.app[1] to work with. It will automatically compile your LESS into CSS whenever you save the document in any text editor. Edit and save a page like variables.less that's included in main.less? It will auto-compile main.less, and any other LESS files that include variables.less when you save it.

[1]http://incident57.com/less/

Re: My intro to LESS - If you're not using it, you should be.

#17
post #12

Also, you should consider: export LESS=-i -g -M -R -x4 -X -f -F -z-1 for a much happier pager.

Mind explaining what this does?

-i = ignore case

-g = highlight the particular string that's been found by the last search command

-M = verbose prompt

-R = all control characters, 'R' for Raw

-x4 = tabs take 4 spaces

-X = don't reinit the screen when the pager exits

-f = force open any kind of file

-F = end the pager when the end of the file has been reached

-z-1 = use 1 less line for a screen's worth of content

Re: My intro to LESS - If you're not using it, you should be.

#18
I really like less.js for quick development. Once everything is working, the less code can be compiled and included as regular css.

My toolchain is currently...

python/apache pure json apis server side

knockoutjs/jquery/less client side

This is very powerful, but the semantics of programming are pretty crazy. I have variables and "functions" in my css, data bindings in the HTML, and a massive ammount of js. The js is sometimes hard to structure.

I almost wish there was a single lightweight coffescript style language to replace the big three (HTML/CSS/JS). The "HTML is for documents" idea is already long gone in most of my code.

Re: My intro to LESS - If you're not using it, you should be.

#19

Earlier quoted context omitted.

Mind explaining what this does?

-i = ignore case -g = highlight the particular string that's been found by the last search command -M = verbose prompt -R = all control characters, 'R' for Raw -x4 = tabs take 4 spaces -X = don't reinit the screen when the pager exits -f = force open any kind of file -F = end the pager when the end of the file has been reached -z-1 = use 1 less line for a screen's worth of content

Thanks, I should probably have actually mentioned what it does initially :)

Couple of minor points:

-F is actually 'quit immediately if the input is less than 1 screen-worth of text'. It means you can just pipe any old thing into it, and if it's only a couple of lines, you don't have to quit manually.

-e/-E is the 'quit when reaching input EOF', with a nice little trick that -e only quits the second time you reach EOF, so you can go right to the end of the file, and to quit just hit space or whatever to seek further.

The other thing is:

   -R : Like -r, but only ANSI "color" escape sequences are
        output in "raw" form. Unlike -r, the screen 
        appearance is maintained correctly in most cases.
whereas you're describing -r. I'd definitely recommend big-R if you don't enjoy periodic symboljunk terminal confusion.
Post reply on HN