Configure style for certain file types
-
Hello, I have the following problem: I often work with “.conf” files that always appear in a certain style (blue italic font and red colon).
I know that I can switch to “normal text” with just one click, but I would prefer .conf files to be displayed as normal text.
Is this configurable? (and sorry for my english) -
It’s because the “Properties file” language type uses
.conf
as one of its default extensions.If you had wanted to set the
.conf
to be some other language (other than “Properties file” or “normal text”), you could have added it to the User ext.: list of that other language using the Style Configurator in the GUI, and the User ext would have taken precedence over the default mapping for that extension. Unfortunately for you, the “normal text” doesn’t have an entry for User ext:. So instead, you will have to manually edit a config file:- Close any
.conf
files- if you leave them open when you exit Notepad++ in the next step, Notepad++ will remember that you had interpreted them as properties files, and it would confuse you into thinking that the changes I am describing didn’t work
- Exit Notepad++ completely (this makes sure it won’t accidentally overwrite the changes you will be making)
- Open
%AppData%\Notepad++\langs.xml
in Notepad++ - Search for
<Language name="props"
- In the
ext="..."
for that XML tag, remove theconf
from the list of extensions for that element - Save, and exit Notepad++
- Run Notepad++, and now opening a
*.conf
file should open it as normal text, not as a properties file.
- Close any
-
Hi Peter,
thank you very much for your detailed help, which immediately worked for me after I had previously tried everything, even reinstalling.
At some point I thought I had set something wrong, because previously I had been able to open conf-files as normal text without any problems for over 15 years.
Only after an update was this no longer the case. But anyway, thanks again for your expertise.
Regards
Jan -
@jan-benheim said in Configure style for certain file types:
I had been able to open conf-files as normal text without any problems for over 15 years.
Only after an update was this no longer the caseHistorical note:
conf
was added to the Properties filetype in v8.4.8 (December 2022).However, updates don’t generally overwrite user-customizable config files in your AppData hierarchy; so your
langs.xml
might not have been updated until you did something drastic (like deleting your old settings), allowingconf
to stay as normal-text longer for you than for a fresh install. -
@PeterJones said in Configure style for certain file types:
Historical note: conf was added to the Properties filetype in v8.4.8 (December 2022).
Then everything is clear. As far as possible, I use portable program versions, as was the case with Notepad++ until six months ago. When I then installed it permanently, nothing was overwritten, but there was simply a program behavior that I was not used to.