Currently we have the possibility to fold and unfold using different shortcuts.
I would like to have "editor.toggleFold" option as well so I can have a single shortcut for that (e.g. Ctrl+M, Ctrl+M as in VS.NET)
E.g.:
{
"key": "ctrl+1",
"command": "editor.toggleFold",
"when": "editorTextFocus"
}
That way, I only have to remember a single shortcut for this and matches various other functionality in vscode. (e.g. toggle line comments/block comments, etc).
A toggle case (upper and lower) would also be nice as mentioned here. https://github.com/Microsoft/vscode/issues/16895
I would love to support this in order to improve the Vim mode. If you are okay with supporting this feature I could try to submit a PR (instructions to where I should start are welcome too).
@rafaelrinaldi Here is a VSCode extension that adds extra commands for code-folding - https://github.com/dakaraphi/vscode-extension-fold
It doesn't yet include a command to toggle foldable code. However, it should be trivial to add a new command to that extension or use it as a reference to build your own extension.
Having to remember all those key to fold/unfold makes harder to use keyboard shortcut and be efficient.
I suggest to implement all of this vscode-extension-fold extension features too:
But with the toggle feature added to unfold too.
I would also like to be able to just toggle with a single key press; for myself in vim mode I'd use
Found the folding code here, in case someone wants to take a stab at it. https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/folding/folding.ts
1+
has this been added? I swear I used to use 1 keyboard shortcut for this
+1
Has this been implemented yet?
+1
+1
+1, very interested in this feature, coming from VS .NET. Any update?
+1
I would also like this, coming from cloud9 ide, which supported inline toggle folding.
+1
Not having a single command for toggle fold irritates me. VSCode not as good as VIM yet.
@babinc VS Code is already better than vim in many ways (vim doesn't and can't have many of the awesome graphical tools we have). On the folding front, VS Code may never be better than vim, per https://github.com/microsoft/vscode/issues/22276#issuecomment-302061827
I wish we had a single editor that could do everything at a perfect level, but there's tradeoffs everywhere. One of the largest tradeoffs is choosing where to spend your time as a dev team. This is one of the places the dev team has chosen not to spend time yet. If I knew the API better, I'd contribute this myself, even though I'm a (very) occasional user of VS Code.
Would be really nice feature. Currently we are forced to use couple button to do the same work.
+1
I found and came to love this functionality in Powershell ISE, I was dismayed to find that it is not also in Code
+1
I don't know why but needing to use a different button for folding and unfolding makes me irrationally annoyed.
I really hope you figure out a way to get this in here despite the design hurdles.
Here's hoping this get done as soon as possible. It's incredible annoying and I'm used to the behavior on VS201* which is to have a toggle.
I hate to be that +1 / me too guy, but this is really a pain in my fingers.
Would just love to see this implemented!
I added a new shortcut Ctrl + K Ctrl + K
Most helpful comment
I would love to support this in order to improve the Vim mode. If you are okay with supporting this feature I could try to submit a PR (instructions to where I should start are welcome too).