Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Default for C++ language

    General Discussion
    3
    6
    238
    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.
    • queenidog1
      queenidog1 last edited by

      I only use NPP for editing (printing) C++ programs but I have to choose that language everytime I paste a C++ program into NPP.

      Is there a way to KEEP it as the DEFAULT? i’m sure it worked that way before (before computer crashes, upgrades to win11, new NPP version, etc).

      I would have thought it would be in Preferences

      PeterJones 1 Reply Last reply Reply Quote 0
      • PeterJones
        PeterJones @queenidog1 last edited by

        @queenidog1 ,

        Settings > Preferences > New Document > Default Language = C++

        Reference

        • https://npp-user-manual.org/docs/preferences/#new-document
        1 Reply Last reply Reply Quote 2
        • Trevor W
          Trevor W last edited by

          I would like the same.

          The following link may solve your problem @queenigog1, but not mine.

          https://community.notepad-plus-plus.org/topic/11687/change-default-language

          Using this method, the filename extension has to match the language to stay that language each time the files are opened.

          However, my CAD software expects a different file extension (.px) to the language used (.pas)

          I would like to suggest making the default language the last language used.

          Therefore, since most people switch languages infrequently, this should suit all.

          Maybe with a switch in setting if people do or don’t want the option.

          I’m not a coder in C++ so I can’t do this myself.

          PeterJones 1 Reply Last reply Reply Quote 0
          • PeterJones
            PeterJones @Trevor W last edited by PeterJones

            @trevor-w ,

            However, my CAD software expects a different file extension (.px) to the language used (.pas)

            Then use the Style Configurator to set px as an extra extension for Pascal.

            … because the Default Language only applies to new files, not to opening existing files. If you want a given non-standard extension to always be interpreted as a particular language, you have to tell Notepad++ that.

            1 Reply Last reply Reply Quote 2
            • Trevor W
              Trevor W last edited by

              Thanks Peter, that worked.

              & this should be the solution to @queenidog1 problem too.

              Ta

              PeterJones 1 Reply Last reply Reply Quote 0
              • PeterJones
                PeterJones @Trevor W last edited by

                @trevor-w said in Default for C++ language:

                that worked.

                Glad it worked for you.

                this should be the solution to @queenidog1 problem too.

                Doubtful. As explicitly stated, the original post was about pasting text into a new document (that is, what you get when you open Notepad++ with no previous session open, or what you get from a File>New), whereas your question was how to treat an already-existing file that you open with File>Open or equivalent. Those are two separate things, and the answer I gave to each is the right way of handling those two separate situations.

                1 Reply Last reply Reply Quote 2
                • First post
                  Last post
                Copyright © 2014 NodeBB Forums | Contributors