SmartMarkdown icon indicating copy to clipboard operation
SmartMarkdown copied to clipboard

Control Folding Behavior

Open michael-cantera opened this issue 12 years ago • 10 comments

This plugin is great -- the folding feature is just what I needed. Is it possible to control the "global folding" behavior so that shift + tab folds/unfolds all <h2>'s rather than <h1>'s? I'm not seeing this in the API and would prefer not to hack your source code.

michael-cantera avatar Sep 25 '12 03:09 michael-cantera

Very good suggestion. You might take a look at GlobalFoldingCommand at smart_folding.py. I think, by adjusting the level of headline, you can achieve that.

I will appreciate very much if you can hack that. Otherwise I would do it later when I have time.

Thanks!

demon386 avatar Sep 25 '12 03:09 demon386

I actually don't like this shift+tab behavior.. shift+tab is a global unident command.

If I have highlighted text, I expect to unident a slab of text, not invoke some code folding thing.

IMHO, you should remove these keybindings, and make them opt-in by manual customization of the keymap. I generally think its a bad idea to intrusively change inherent Sublime key bindings.

I think you should also be able to scope them down even further, so that they won't, for instance, apply when a block of text is selected.

Iristyle avatar Oct 17 '12 14:10 Iristyle

Shift + Tab conflicts with traversing table cell backwards and global unfolding.

Sorry, too early to comment. It works as expected, it seems I was in last cell to out of table and + to re-enter into to last cell.

palaniraja avatar Dec 23 '12 17:12 palaniraja

Personally, I use Super + [ as global unindent, as Shift + Tab does not unindent the current line when there is no selection.

Is this the standard behaviour on platforms other than OS X?

djs070 avatar Jan 17 '13 10:01 djs070

I think what michael-cantera is saying, at least as I remember emacs working, is that shift+tab toggles through: all h3s closed, all h2s closed, all h1s closed, all open. This would be a REALLY useful feature. (So I guess this is really a feature request / enhancement.)

kaimantsch avatar Mar 26 '13 05:03 kaimantsch

Yes, great plugin - Kalmantsch, on my emacs at least, shift-tab cycles thru all unfolded, just H1, then all Headings, but no bodytext. This is IMHO the best compromise. Would LOVE to see this. Second feature request: emacs (and MS Word, which is a great outliner if nothing else) gives you 8 options for moving headlines: up, down, promote, demote (mapped to the arrow keys), and for each you can just move the heading (add Shift key for this) or move everything under the heading too. Right now SmartMarkdown only has two of these. Real outline junkies need all 8. Would this be possible? plEEEEASE?

stevepowell99 avatar Dec 16 '13 15:12 stevepowell99

I would be interested in offering a small bounty to get something like this working. Those eight motions plus some way of folding/unfolding level by level globally.

stevepowell99 avatar Jun 29 '14 15:06 stevepowell99

Yes, I'd add my interest in this request for a cycling fold command as well. That is, unfold to show just the h1s, just the h2s, just the h3s, etc.

reagle avatar Aug 05 '14 13:08 reagle

BTW: It looks like there's toggle functionality in the fold-em-all branch from over a year ago. Why no merge?

reagle avatar Aug 05 '14 13:08 reagle

+1 for any or all of these suggestions!

stevepowell99 avatar Oct 31 '14 09:10 stevepowell99