I have a habit of using code editors for notes in the following fashion:
a topic
. a note
? a question regarding the note
- a to do item
. some more details
. another note
. more details
another topic
...
What I like about VS Code is that it allows to fold (collapse) blocks in txt files based on their indentation (like for Python):
a topic
+ . a note
. another note
. more details
another topic
...
What I don't like, though, is that it also includes empty lines into collapsed blocks: the line after . more details
has no indentation, but when I collapse that block I get
a topic
+ . a note
+ . another note
another topic
...
while I want it to be
a topic
+ . a note
+ . another note
another topic
...
Can you suggest what options should I change to get this difference about collapsing?
On Windows, press Alt + Z (macOS: Option ⌥ + Z ) to toggle word wrapping, or, select View > Toggle Word Wrap from VSCode Menu. Show activity on this post. For Windows, Pressing Alt+Z will break the line.
Ctrl + Shift + [ on Windows and Linux. ⌥ + ⌘ + [ on macOS.
I don't know of a way to prevent the last line from being folded in VS Code, unless you use a 3rd party extension.
If you search extensions for 'folding' you should see several. Explicit Folding appears to have options to control this. But there are a lot more. Take a look & see if one fits your needs. If not then the only way to get this would be to develop an extension to handle this the way you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With