ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

notepad2-mod: custom code folding for txt files?

<< < (4/5) > >>

Nod5:
dr_andus: the changes are easy to do manually.

First click view > customize schemes...

Then in the popup window:
- Default text > associated filename editbox: remove txt
- YAML > associated filename editbox: add txt
- YAML >
comment: change to: bold; fore:#0A246A
identifier: change to: bold; fore:#0A246A;back:#D7D7FF
error: clear the style editbox

I think that is it. There are some settings left but I haven't seen them get triggered accidentally in any textfile so far. The popup has dialogs for quickly changing any color and there is a list of possible variables to use.

dr_andus:
Nod5 - many thanks for the detailed instructions. Works like a charm! This must be one of the simplest outliners out there...

dojibear:
How do you create a "fold point"?


Looking for an outliner, followed Dr. Andus here. Clearly to use as an outline, you can set up a hierarchy and collapse/uncollapes portions. Elesewhere I find lists of commands to fold and unfold "fold points" and to jump to the next one. But no explanation of how to turn some parts of a plain text file into a "fold point".

<edit> never mind, I found the problem. I would delete "txt" from the list in Default, click OK, and something somewhere would put it back in. So I was never in the mode that did outlining. Finally I made YAML the default mode, and it works okay. The "fold points" are clearly marked.

peter.s:
"Code Browser" (freeware) has some good explanations on different folding paradigms.

But I doubt ANY editor is perfect for managing text snippets (and even for coding) since they all seem to present that common prob that you have not only to code / mark up the folding point (begin=not hidden title of the hidden text part), but also the end point of that hidden structure, again and again, and it does NOT seem to be possible in any of them to define ANY "begin new part (hidden except for its title line)" code (= begin), as the END of the previous hidden structure, so there is a lot of (imo) unnecessary "hide mark-up" to do here.

On the other hand, most 2-pane outliners perfectly export to plain-text .txt files, so why not manage your code within such an outliner and have the exported text file compiled then; this makes available rtf formatting within the "work copy" of your code, which I find extremely helpful.

All the more so with text notes: Almost any dedicated 2-pane outliner does the M of text notes in a perfect way; why bother with the very limited capabilities of editors (folding or not) instead?

Of course, a 1-pane outliner would often be the worst solution: It lacks many capabilities of editors, and it doesn't offer the clarity of a 2-pane outliner either (which will become very important if you have hundreds or thousands of such items (or folded text bodies within your .txt file).

Again, a capable pc can export thousands of items of a 2-pane outliner into the corresponding .txt files within a second, and with a macro, you can automate this transition from outlining to file-for-compilation (which is not even necessary for text notes, compared with source code), so why clinging to bad editor solutions when there are better, i.e. more appropriate ones?

This being said, I'd be interested in knowing a folding editor in which you would just do some special char before title lines, and which would then fold anything else (folding editor, I said, i.e. not speaking of KEdit and such here, bec there is a prob with those whenever you then want to see the text underneath such a title line, and just that part).

More info would be more than welcome.

Nod5:
I'm late on the ball with a reply but here goes: by modifying the YAML syntax in notepad2-mod you can simply use tab indentation. Write a header line without indentation, press enter, press tab, start typing. There is the fold point for you. Notepad2-mod then autoindents to the same tab level on each enter. To end the fold just start a new line without indentation. This is very easy to do and remember and avoids cluttering the text with extra tags/code. Very usful for notes that that fit well in a nested format. Fold all to get a zoomed out view. Unfold for details.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version