File extension List
-
Hi All, is it possible to edit the list of file extensions in the āOpenā dialogue box? By default the list is quit big. Thanks
-
Every language in
%AppData%\Notepad++\langs.xml
š (or your installationās equivalent config file location) will show up in the Open and Save As dialog file-type lists.To get rid of entries in that list, you
would have tocould remove the<Language ... </Language>
section for each of the entries that you donāt want from thelangs.xml
(following the sequence for editing Notepad++ config files) then restart Notepad++. However, the major caveat for that is that if you remove a given language fromlangs.xml
, Notepad++ will not be able to correctly syntax-highlight that language.As an alternative suggestion: the order of the file types is determined by the order in
langs.xml
ā so if you have just 2-5 languages you normally use, then you could move it so those were the first 2-5 languages (after<Language name="normal" ext="txt"/>
) ā after restarting, then those more-frequent languages would be your first few choices in the pulldown, so they are easier to choose when opening or saving a file, without losing access to the syntax highlighting on languages you use less often.update: see below, there is another option
-
After my above post, I had another idea that I experimented with: there is actually another way: you can use Settings > Preferences > Language dialog. If you move languages from the Available items to the Disabled items, as in the screenshot below:
ā¦ then after restarting, the only languages that show up in the Open and Save As file-type drop-downs are the ones in the Available items list:
So thatās a simpler way of removing them from the list
-
I donāt know if youād call these techniques āhacksā (probably), but my first thought about them is that it might be nice to pull this info into the user manual so that it is not ālostā for the future. But maybe since they are hacks, they donāt belong there.
-
The ādelete from
langs.xml
ā is definitely a hack. The reorder is borderline hacky. But it would make sense to document that the Language list affects the open/save-as pulldowns. -
@PeterJones Thanks Peter thats great, really appreciate your help with this, do you know if there a way to add a language / file extension tyoe to the list? I use it for editing Bentley MX input files so *.inp
-
You cannot arbitrarily add languages to the
langs.xml
and expect it to fully work, becauselangs.xml
was made to control the built-in languages, not add arbitrary language or control UDL.However, my experiments show that when I add an unknown language to
langs.xml
, like<Language name="normal" ext="txt"/> <Language name="BentleyMX" ext="inp" /> ...
(and restart after changing/saving
langs.xml
, so Notepad++ re-readslangs.xml
)Then when I do an Open (or Save As), it will show up as a second Normal Text in the pulldown:
ā¦ so itās not perfect (because it calls itNormal text
again, instead ofBentleyMX
), but it does add a new mask to the pulldown, which might be enough for youIf you also have a User Defined Language (UDL) defined ā for example, I created one called
BentleyMX
that has Ext.: defined asinp
ā then when you open theblah.inp
file, it will automatically apply the UDL styling (which you would have to set up) to it.
(Per Alanās note, I would call adding a unknown language to
langs.xml
a āhackā. But it does seem to āworkā per your use-case, insofar as Open and Save As dialogs are concerned.)For the right way to do it: Notepad++ , in theory, could have a way to add the UDL types with their extensions to that list, and I requested that years ago but it hasnāt been implemented yet. If having a native implementation, where Notepad++ automatically includes those in the list as you create more UDL, you could go over there and āupvoteā (click on the thumbs-up) and/or comment, agreeing that youād like it implemented.
-
@Mark-Davies-0 said in File extension List:
do you know if there a way to add a language / file extension tyoe to the list?
Are you talking about user-defined languages? Follow that link for relevant documentation.
-
@PeterJones Hi Peter, thats great thanks so much for your help!
-
@PeterJones said in File extension List:
I requested that years ago but it hasnāt been implemented yet.
Prompted by this, and the thought, āI should be able to figure out how to take the list of UDL extensions, which should be available in a data structure already, and add them to the other list of filters for the SaveAs/Open dialogsā, I tried it out, even though I donāt have much experience in the codebase: I was able to figure it out, and put in a PR for it ā that PR has been merged, so that means the SaveAs/Open dialog filters will show all UDL extensions in the file-type filter, starting in the next release. š
-
@PeterJones ,
Bravo @PeterJones. Hope to get to that point, someday.
:-)