• Login
Community
  • Login

Normal Text as default language

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
4 Posts 3 Posters 3.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    D Visser
    last edited by Mar 25, 2020, 12:45 PM

    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

    R 1 Reply Last reply Mar 25, 2020, 3:11 PM Reply Quote 0
    • P
      PeterJones
      last edited by Mar 25, 2020, 2:52 PM

      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.`

      D 1 Reply Last reply Mar 30, 2020, 9:48 AM Reply Quote 2
      • R
        rinku singh @D Visser
        last edited by Mar 25, 2020, 3:11 PM

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • D
          D Visser @PeterJones
          last edited by Mar 30, 2020, 9:48 AM

          @PeterJones Thank You Peter; works !

          David Visser

          1 Reply Last reply Reply Quote 2
          2 out of 4
          • First post
            2/4
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors