Author Topic: Syntax highlighting for extensionless files  (Read 3532 times)

Offline danh

  • Multiple posting newcomer
  • *
  • Posts: 11
Syntax highlighting for extensionless files
« on: June 16, 2011, 10:02:58 am »
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!

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: Syntax highlighting for extensionless files
« Reply #1 on: June 17, 2011, 10:11:26 pm »
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.)
« Last Edit: June 17, 2011, 10:14:17 pm by ouch »

compudemon

  • Guest
Re: Syntax highlighting for extensionless files
« Reply #2 on: July 07, 2012, 06:04:45 am »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Syntax highlighting for extensionless files
« Reply #3 on: July 07, 2012, 11:41:58 am »
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!]