Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally fold other common blocks #67

Open
iago-lito opened this issue Dec 15, 2016 · 2 comments
Open

Optionally fold other common blocks #67

iago-lito opened this issue Dec 15, 2016 · 2 comments

Comments

@iago-lito
Copy link

iago-lito commented Dec 15, 2016

To browse long functions, I sometimes wished that if, elif, else, for, while, try and except blocks were also folded by SympylFold. Would it be difficult to have them optionally folded ? Or maybe just if they were more than n lines long, something like:

let g:SimpylFold_fold_import = 0
let g:SimpylFold_fold_docstring = 1  
" but also:
let g:SimpylFold_fold_ifelifelse = 5  " fold if more than 5 lines long
let g:SimpylFold_fold_for = 1         " always fold
let g:SimpylFold_fold_while = 0       " never fold
let g:SimpylFold_fold_tryexcept = 10  " fold if more than 10 lines long

.. or.. maybe it would be a nightmare?

@tmhedberg
Copy link
Owner

I don't think it would be difficult. It might be a nightmare of configuration options. :)

Usually, the minimum number lines within a fold is determined by Vim's built-in foldminlines option. If you want to set different minima for different fold types, that might get complicated, especially when it comes to figuring out how to interact with foldminlines in an intuitive way. But Boolean options to turn on and off folding of different types of blocks should be fairly straightforward.

That said, it's not something I'm interested in implementing myself, as I doubt I'd use it, and my preference is generally to keep this script simple rather than adding features. I would consider a pull request, though, if you wanted to send one.

@iago-lito
Copy link
Author

Alright, I'll get into this if I find spare time.. not quite soon of course ;)

(I didn't know Vim only had one foldminlines option, this'll make it trickier for sure :\ )

Thank you for support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants