Default for C++ language
-
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
-
Settings > Preferences > New Document > Default Language =
C++
Reference
-
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.
-
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.
-
-
@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.