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

Request body folding #103

Open
giftig opened this issue Aug 9, 2024 · 1 comment
Open

Request body folding #103

giftig opened this issue Aug 9, 2024 · 1 comment

Comments

@giftig
Copy link

giftig commented Aug 9, 2024

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.

@giftig
Copy link
Author

giftig commented Aug 9, 2024

Side note: I've found this plugin super useful for juggling many different elasticsearch queries and have also started using it for regular RESTful API calls in a lot of cases rather than piping stuff to curl as is my normal approach, so thanks, great plugin 👍

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

No branches or pull requests

1 participant