News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Syntax highlighting for extensionless files

Started by danh, June 16, 2011, 10:02:58 AM

Previous topic - Next topic

danh

Hello,

I was wondering if it's possible to associate individual extensionless files with the appropriate syntax highlighter.  For example, I have lots of python, bash, perl, etc. scripts that have no extension (and that I am not at liberty to rename), and it is frustrating to have to edit them without highlighting.

Is there any way to add syntax highlighting for these files, perhaps by parsing the shebang line (#!...)?

Thanks!

ouch

#1
You can go to edit->highlight mode and select whatever you want.

You can specify a file to use a specific highlighter as well. Just go to settings->editor->syntax highlighting. From there select the highlighter you want the file to use then simply add the file name to the file extension mask list. (It works based on wildcards, so if there is none it will look for the absolute file name when entered.)

compudemon

i tried a few tests of the syntax highlighter and even when i add *. to the lists of masks for c++ it fails to highlight any of the standard header files.. iostream istream however if i add *.txt to the c++ mask and rename iostream to iostream.txt, the highlighting works also if i set the mask to *.* or * the highlighter will work on *. files, but then it highlights every file.

oBFusCATed

The standard headers don't have the . at the end, so the  '*.' wildcard won't match them.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]