I want to fold in text files.
-
I created a User Defined Language called TXT and then selected it from the Language menu. There must be more steps because I’ve chosen folding options from the View menu.
-
It’s foldable for me:
In your UDL definition for this “TXT” language, did you actually define the Folding In Code Open/Close keywords? Because that’s what’s required to tell Notepad++ where to start and end the folds when you use the View menu’s folding commands.
Can you show us a screenshot of the UDL for TXT? Please include the line numbers and fold margin on the left, the status bar at the bottom, and enough text in the screenshot that we can see that you actually have text which matches the Open/Close keywords defined for your UDL.
-
This post is deleted! -
@Luis-Piña-III Do I need to select the UDL for every tab that I open?
-
@Luis-Piña-III said in I want to fold in text files.:
Do I need to select the UDL for every tab that I open?
If you have an extension set for your UDL, then if you open a file with that extension, it will automatically apply your UDL for that tab (even if you do something weird like assign your UDL the extension
txt
– the UDL extension list overrides the builtin filetype extension list).But if you just use File > New (or the toolbar or keyboard shortcut equivalent), then you will have to use Language > MyUDLName (or do a File > Save As and give it an extension which matches your UDL definition).
The same is true of every built-in filetype as well (when you create a new file, you have to manually assign the language or do SaveAs; when you open an existing file, it knows).
-
How do I set an extension for TXT?
-
@Luis-Piña-III said in I want to fold in text files.:
How do I set an extension for TXT?
Once you’ve saved your UDL, when you look at the Language > User Defined Language > Define your language… dialog box and have that language selected, you get a Ext: box, where you can type
txt
to define that*.txt
will be interpreted as your UDL. (You can see this box in my screenshot in my first reply, above.)https://npp-user-manual.org/docs/user-defined-language-system/#udl-dialog-box-or-window
-