27

I want to have files with a .less extension use the CSS syntax highlighting in NetBeans, and I don't have any clue how to do this.

I found a rather time consuming way to do this (http://netbeans.dzone.com/tips/quickstart-guide-language-supp), but it hit me that it must be easier way to do this.

Anyone knows?

1
  • 1
    Note that since Netbeans 8.0 LESS support is present in the IDE by default, no more need for plugins. And it works great! Commented May 9, 2014 at 22:59

5 Answers 5

23

You just have to add a new file type in Netbeans > Tools > Options > Miscellaneous > Files. Note that Netbeans will mark as errors some less features like variables...etc

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you! It works perfectly, well except for that already mentioned, but I can live with that. Seems I just missed that, must get glasses or something.
This method is far better than the LessCSS plugin as it's a bit buggy and does not support code completion and auto-indentation, which is absolutely vital if you write lots of CSS.
this is the correct answer for me, I don't think there is any need for a plugin. just define a new extension and use text/css highlighting. like someone mentioned in this link: andygroff.com/2010/10/netbeans-6-9-custom-syntax-highlighting/…
Strange, I don't have any MIME types to choose from. What's up with my Netbeans installation? 7.3.1 on Win7-64. i.imgur.com/BtIrYae.png
11

a module which adds full less highlighting support can be downloaded from the following page: http://plugins.netbeans.org/plugin/32782/lesscss-module

i tested the module with netbeans 7.0 and it worked flawless.

5 Comments

It doesn't work that well in 6.9.1, some short cuts break and the * key doesn't seem to work.
Doesn't work well in 7.0.1 either. No completion, highlighting is partially broken.
for me it still "works", if i write for example: "test: xxx" the xxx is displayed wrong. you only see the rectangle of a missing symboyl, but if you don't bother and just finish writing and end with a ";" the wrong symbol changes back to normal. quite unhandy but it better than no highlighting
"Flawless" is an euphemism here, as one hasn't full CSS/LESS snytax highlighting, no auto-completing for CSS, no syntax error-highlighting, …
I works in 7.4 same as feeela said you don't have the "errors" you see in css but you wont get anything else
6

You might try out the new version of the plugin that was already mentioned:
http://plugins.netbeans.org/plugin/41315/lesscss-module

GitHub repository, now gone, was available at:
https://github.com/khairie/lesscss-module

For me it seems to work quite fine despite some minor bugs in coloring. It is missing some features and e.g. does not offer automatic formatting, though.

Note that basic editing support for Sassy CSS and LESS CSS preprocessor files has been added to NetBeans dev build:
http://wiki.netbeans.org/NewAndNoteWorthy

1 Comment

For me works in 7.3 beta too. Github repository is gone, but some forks left. However often crashes.
3

The SCSS Support plugin also works with less files, just need to add the "less" file extension with text/x-scss MIME in Tools/Options/Miscellaneous/Files.

Comments

1

Since Netbeans 7.4 less is supported by Netbeans without the need for an additional plugin.

For older version of Netbeans there are two plugins: http://plugins.netbeans.org/plugin/32782/lesscss-module and http://plugins.netbeans.org/plugin/41315/lesscss-module

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.