Add syntax highlighting to .less-files in NetBeans
Asked Answered
D

5

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?

Diapedesis answered 6/7, 2010 at 20:38 Comment(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!Garbers
F
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.

Fassold answered 30/4, 2011 at 23:43 Comment(5)
It doesn't work that well in 6.9.1, some short cuts break and the * key doesn't seem to work.Theophany
Doesn't work well in 7.0.1 either. No completion, highlighting is partially broken.Thermy
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 highlightingFassold
"Flawless" is an euphemism here, as one hasn't full CSS/LESS snytax highlighting, no auto-completing for CSS, no syntax error-highlighting, …Destinydestitute
I works in 7.4 same as feeela said you don't have the "errors" you see in css but you wont get anything elseMaxine
H
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

Hufnagel answered 18/7, 2010 at 16:43 Comment(4)
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.Diapedesis
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.Salivate
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/…Septillion
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.pngRusk
F
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.

Fassold answered 30/4, 2011 at 23:43 Comment(5)
It doesn't work that well in 6.9.1, some short cuts break and the * key doesn't seem to work.Theophany
Doesn't work well in 7.0.1 either. No completion, highlighting is partially broken.Thermy
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 highlightingFassold
"Flawless" is an euphemism here, as one hasn't full CSS/LESS snytax highlighting, no auto-completing for CSS, no syntax error-highlighting, …Destinydestitute
I works in 7.4 same as feeela said you don't have the "errors" you see in css but you wont get anything elseMaxine
P
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

Py answered 9/6, 2012 at 17:21 Comment(1)
For me works in 7.3 beta too. Github repository is gone, but some forks left. However often crashes.Li
E
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.

Epoxy answered 26/1, 2013 at 11:21 Comment(0)
L
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

Laurent answered 15/1, 2015 at 8:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.