hotkey to browse user UDLs
-
Hi all,
noob question:
How to add user hotkey for “next/prev listed UDL”?
Thanks
Max -
There is no npp message which can be used to do this kind of operation
but may I ask what exactly you try to achieve?
To switch between different UDLs for the same document?
To assign an UDL to an open document?
Something else? -
Hi Ekopalypse.
sole use of this hotkey would be to find my go-to-UDL for various documents faster.
It takes ages to click through them and I just downloaded 100 or so and am quite curious.
I know, sounds lazy, but i thought there is an easy faster way. -
@MaximiIian said in hotkey to browse user UDLs:
I just downloaded 100 or so
Delete the ~95 you don’t need; sure should make finding the one you want easier.
-
@MaximiIian said in hotkey to browse user UDLs:
I just downloaded 100 or so and am quite curious.
WooHoo! We apparently have an actual user of https://github.com/notepad-plus-plus/userDefinedLanguages. I’m glad that wasn’t wasted effort.
@MaximiIian , like @Alan-Kilborn , I would highly recommend only keeping the UDL that you’re actually likely to use. If you do that, then the extension-awareness should usually not conflict with each other, and Notepad++ can automatically pick the right UDL for your file based on file extension. For example, I have Markdown defined as a UDL (though it’s a different UDL than comes with Notepad++ natively), with the extension list of
md markdown readme
, so if I go File > New then File > Save As, and save a file with any of.md
or.markdown
or.readme
, Notepad++ will immediately apply my Markdown UDL to the active file, even before I’ve started typing anything – no Language pulldown menu required; or if I go File > Open and picksomething.readme
, it will automatically apply the Markdown UDL when it opens that pre-existing file as well.The only times I ever really use the Language menu:
- When defining a new UDL or editing an existing UDL for my own use
- When I’m helping someone in this forum, and I want to do something strange like
- intentionally applying CSS or JS highlighting to an HTML file
- when I have a quick File > New tab that I’m never going to save, but want to quickly apply a temporary UDL to the temporary file buffer. (unlike some, I don’t generally save a file for each person on the forum I help; sorry. I just use the forum itself as my archive of what I’ve done for others; NPP screenshots for the forum, OTOH, I rarely get around to deleting, despite the fact that they’re archived here and for my animated ones at imgur as well. Which reminds me, probably about time to clean out my NPP image directory on my work laptop. Thanks. :-) )
That said, once you’ve pared it down to a manageable set of actually-used UDL, if you have a couple that you like switching between (akin to toggling generic XML to a specific XML-based language, or some such), there was a whole thread (https://community.notepad-plus-plus.org/topic/18988/how-to-change-syntax-via-hotkey) about various ways to switch between syntax highlighters (between two builtin lexers or between two UDLs); you might want to read through that thread, and see if any of that helps you.