Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Control Folding Behavior #10

Open
michael-cantera opened this Issue · 10 comments

8 participants

@michael-cantera

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.

@demon386
Owner

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!

@Iristyle

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.

@palaniraja

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.

@precise54

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?

@kaimantsch

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.)

@vovkkk vovkkk referenced this issue from a commit in vovkkk/SmartMarkdown
@vovkkk vovkkk attempt to address demon386/SmartMarkdown#10
adds defs fold_2() and fold_3() to folding h2 and h3; trying to guess
which headlines to fold
b4e8247
@vovkkk vovkkk referenced this issue from a commit in vovkkk/SmartMarkdown
@vovkkk vovkkk options for folding
0 (toggle), 1 (first level only), 2 (second level only), 3 (third level
only)
demon386/SmartMarkdown#10
9c64fe8
@stevepowell99

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

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.

@reagle

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

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

@stevepowell99

+1 for any or all of these suggestions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.