Skip to content

Request body folding #103

@giftig

Description

@giftig

Having folding in the syntax for *.rest would be useful as it'll make it much easier to organise requests in a worksheet. Initially I tried to manually create folds and save them via techniques like this: https://stackoverflow.com/questions/37552913/vim-how-to-keep-folds-on-save but inevitably as I modify requests and add new requests my folds end up broken because they're just created as line ranges.

If my vimscript-fu is up to the task I'll see if I can add some basic folding and contribute it, though I wonder the simplest approach is embedding other syntax formats, i.e. making it understand that the body is JSON, which would both add better syntax highlighting and solve the fold problem, as the JSON syntax knows how to fold JSON already. I've seen effective embedded syntaxes in https://github.com/xolox/vim-notes for example. Obviously one complication with that approach is that your body might not be JSON and you'd have to indicate content type in a way the syntax logic could understand, so just being able to fold the whole body would be a start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions