Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: danh 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!
-
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.)
-
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.
-
The standard headers don't have the . at the end, so the '*.' wildcard won't match them.