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 fail

    David Visser



  • Hmm… There isn’t a way to override an extension to truly use Normal Text.
    It might be possible by editing langs.xml to change ext="..." to ext="" 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:

    1. close all files of the type you want to add (.txt, .ini, .log, etc)
    2. Language > User Defined Language > Define Your Language (in older Notepad++, it may be Language > Define Your Language without the submenu)
    3. Without any formatting defined, Save As in the UDL dialog, and give it a name like PseudoTxt
    4. 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:
      46746527-eddf-41eb-bcb2-e8c8fff490f2-image.png
    • add ini (without the .) to the UDL ext list, like:
      5250d4f2-607b-42ed-8643-eccb5dfa1dc0-image.png
    • now if I load blah.ini, it will not be highlighted, and will claim to be “User defined language file - PseudoTxt”
      d841a54d-1ad4-4d6d-8ea1-b46fe0ee8b3c-image.png

    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


Log in to reply