Git Product home page Git Product logo

Comments (4)

tweekmonster avatar tweekmonster commented on May 22, 2024

I could easily add a way to configure which blocks to fold on. I would have to look into the fold markers, so no promises there.

from braceless.vim.

amigrave avatar amigrave commented on May 22, 2024

You mean user configurable block identifiers !? That would be cool indeed !

I don't know how markers works under the hood (I don't know vimscript in fact) but as they allow one to declare custom folding they are quite handy.

from braceless.vim.

tweekmonster avatar tweekmonster commented on May 22, 2024

@amigrave Yup, I'm working on configurable block folding. The issue off the top of my head with fold markers is that braceless deals with inferred block endings, not explicit ones. Something like this might not work out well:

def example1():
    # line 1
    # {{{
    # line 3
    pass

def example2():
    # line 1
    # }}}
    # line 3
    pass

I know that's not that likely to happen on purpose, but could happen in pastes. I do want to add folding for collection symbols ((), [], and {}), but that's something I want to tackle after I've figured out a better way to handle foldexpr. It's still pretty slow even with caching and it most likely could be sped up by doing "good enough" block scanning instead of getting the true block boundaries. So, I'd rather not slow it down by checking for explicit start and end symbols before using block boundaries at the moment.

from braceless.vim.

tweekmonster avatar tweekmonster commented on May 22, 2024

You can set folds for def or class using this in your configs:

let braceless#pattern#python = {
\  'fold': '\<\%(def\|class\)\>\_.\{-}:\s*\%(\_$\|#\)'
\ }

from braceless.vim.

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.