Notepad++ not syntax highlighting my files

Viewed 75818

Until a week ago I was happily coding html.erb files in Notepad++ with syntax highlighting. Then my hard drive crashed.

I reinstalled Notepad++ on my new system but when I open my html.erbs, only a few of them are highlighting properly.

I think the problem might be that most of these files are being considered 'normal text files', where the few that are working are considered 'html files'. I tried 'save as' html file of the same name, but it isn't working. How can I get my syntax highlighting back? This is seriously slowing me down.

8 Answers

So I Know this problem was solved 7 years ago but it's the top result on google so I wanted to add what the solution to my problem.

Under Settings -> Preferences... -> Languages

I had stupidly disabled python without realizing that that's what I was doing, just had to put it back into available items.

Go to Settings -> Style configurator... then disable Enable global foreground color and Enable global background color. This fixed my problem.

I had this problem when reinstalling notepad++ because with the new install, .r source code files were being recognized as REBOL instead of R. I had to manually remove the r file extension from the REBOL key in the langs.xml file. For instructions, see the similar question on the Notepad++ community forum at this link.

My issue was very dumb but maybe people will have the same:
Some themes apply the same syntax coloring to all elements of the same language (example: python in Ruby Blue theme is just not colored in anything else than white).
Changing the theme to one that differentiates elements of the language I was coding in solved the issue.

Related