Normal Text as default language
-
Hallo,
How to define Normal Text as my default language (Language>N>Normal Text) and this for all file extensions:, txt, .ini, .log, etc etc
Please step by step advise; every time I try this via DEFINE YOUR LANGUAGE I failDavid Visser
-
Hmm… There isn’t a way to override an extension to truly use Normal Text.
It might be possible by editinglangs.xml
to changeext="..."
toext=""
on all the languages (or on all extensions that you want to associate as Normal Text, if it isn’t truly all extensions); and maybe also add them to the<Language name="normal" ext="txt" />
list, like<Language name="normal" ext="txt ini log etc" />
(without dots, space separated)However, in general, setting the extension to a saved and named UDL should override that extension to use that UDL instead of the builtin lexer for that extension. The steps i would take:
- close all files of the type you want to add (.txt, .ini, .log, etc)
- Language > User Defined Language > Define Your Language (in older Notepad++, it may be Language > Define Your Language without the submenu)
- Without any formatting defined, Save As in the UDL dialog, and give it a name like
PseudoTxt
- In the ext list, add in all extensions that you want to override, without the dot. if there is more than one, separate with a space between each
For example, if I wanted
*.ini
to not be syntax highlighted:- first, here it is normally highlighted:
- add
ini
(without the.
) to the UDL ext list, like:
- now if I load
blah.ini
, it will not be highlighted, and will claim to be “User defined language file - PseudoTxt”
Note that if you ignore my advice, and make the change while the
.ini
file is open, it will not change lexers to the UDL until after you’ve closed the file and reopened the file (I literally meant closing the file and re-opening the file: Exiting notepad++ might save the session, and the session information may include your chosen lexer, so exiting notepad++ and re-running might not update the lexer for that extension). Or you will one time have to manually change the lexer using Language > PseudoTxt.Is there a reason you don’t like the highlighting in
.ini
files? Personally, I find it makes it easier to read and edit with the highlighting.` -
This post is deleted! -
@PeterJones Thank You Peter; works !
David Visser