Giter Club home page Giter Club logo

Comments (4)

tmhedberg avatar tmhedberg commented on July 20, 2024

By "indentation block", do you mean the bodies of loops and conditional statements? There is no option for that currently, and I originally left it out on purpose (just because I didn't want it, personally).

I'm not strongly opposed to the idea, but Vim has built-in support for folding based on indentation level, without any plugin (:set foldmethod=indent), so I don't see much need to build custom support for this.

Does the built-in indentation-based folding work well enough for your case?

from simpylfold.

yxiong avatar yxiong commented on July 20, 2024

Yes, by "indentation block" I meant bodies of loops and conditional statements. :set foldmethod=indent works for those indentation blocks, but when I do that, I lost folding for imports and docstrings. Is there a way to use foldmethod=indent together with SimpylFold plugin, so that I can take the good part of both world?

from simpylfold.

tmhedberg avatar tmhedberg commented on July 20, 2024

Unfortunately, there's not an easy way that I know of to combine multiple fold methods.

There are some partial workarounds you could try, like this tip for using indentation-based folding along with manual folding, but this has some significant drawbacks which you might not be happy with. You have to define the non-indentation-based folds manually in each file, and they won't be saved across sessions without using some tricks with :mkview/:loadview.

Basically, this functionality would have to be added to the plugin if you want it to be automatic. I'm willing to review a patch for that, if you want to send one, but I'm not likely to work on it myself.

from simpylfold.

yxiong avatar yxiong commented on July 20, 2024

I probably won't have the expertise or bandwidth to add this functionality as a pull request. So feel free to close it as "won't fix" or keep it open for future contributors, whichever you prefer.

Thanks again for all the discussion and information, @tmhedberg !

from simpylfold.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.