{"id":13503342,"url":"https://github.com/bfrg/vim-jqplay","last_synced_at":"2025-04-09T19:24:09.387Z","repository":{"id":45587900,"uuid":"217536719","full_name":"bfrg/vim-jqplay","owner":"bfrg","description":"Run jq interactively in Vim","archived":false,"fork":false,"pushed_at":"2024-03-05T22:44:40.000Z","size":92,"stargazers_count":112,"open_issues_count":2,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-23T21:22:48.347Z","etag":null,"topics":["jq","vim","vim-ftplugin","vim-plugin","vim9script"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bfrg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-25T13:13:11.000Z","updated_at":"2025-03-14T01:42:43.000Z","dependencies_parsed_at":"2024-01-17T16:08:38.981Z","dependency_job_id":"d9e67772-f378-4bce-a1e5-80b099347cd1","html_url":"https://github.com/bfrg/vim-jqplay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfrg%2Fvim-jqplay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfrg%2Fvim-jqplay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfrg%2Fvim-jqplay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfrg%2Fvim-jqplay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfrg","download_url":"https://codeload.github.com/bfrg/vim-jqplay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248096282,"owners_count":21047014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jq","vim","vim-ftplugin","vim-plugin","vim9script"],"created_at":"2024-07-31T22:02:47.537Z","updated_at":"2025-04-09T19:24:09.330Z","avatar_url":"https://github.com/bfrg.png","language":"Vim Script","funding_links":[],"categories":["Vim Script","Vim script","Integrations"],"sub_categories":[],"readme":"# vim-jqplay\n\nRun [jq][jq] on a json buffer, and interactively update the output window\nwhenever the input buffer or the jq filter buffer are modified similar to\n[jqplay.org][jqplay].\n\n**Requirements:** Vim 9\n\n\u003cdl\u003e\n  \u003cp align=\"center\"\u003e\n  \u003ca href=\"https://asciinema.org/a/276970\"\u003e\n    \u003cimg src=\"https://asciinema.org/a/276970.png\" width=\"480\"\u003e\n  \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/dl\u003e\n\n\n## Usage\n\n### Quick Overview\n\n| Command                          | Description                                                                            |\n| -------------------------------- | -------------------------------------------------------------------------------------- |\n| `:Jqplay [{args}]`               | Start an interactive session using the current json buffer and a new jq script buffer. |\n| `:JqplayScratch [{args}]`        | Like `:Jqplay` but creates a new scratch buffer as input.                              |\n| `:JqplayScratchNoInput [{args}]` | Like `:JqplayScratch` but doesn't pass any input file to jq.                           |\n\n### `:Jqplay`\n\nRun `:Jqplay {args}` to start an interactive jq session using the current (json)\nbuffer as input and the jq options `{args}`. The command will open two new\nwindows:\n1. The first window contains a jq scratch buffer (prefixed with `jq-filter://`)\n   that is applied interactively to the current json buffer.\n2. The second window displays the jq output (prefixed with `jq-output://`).\n\n`{args}` can be any jq command-line options as you would pass them to jq in the\nshell.\n\nJq is invoked automatically whenever the input buffer or the jq filter buffer\nare modified. By default jq is executed when the `InsertLeave` or `TextChanged`\nevents are triggered. See [configuration](#configuration) below for how to\nchange the list of events when jq is invoked.\n\nOnce an interactive session is started the following commands are available:\n* `:JqplayClose[!]` ─ Stop the interactive session. Add a `!` to also delete all\n  associated scratch buffers.\n* `:Jqrun [{args}]` ─ Invoke jq manually with the jq options `{args}`.\n* `:Jqstop` ─ Terminate a running jq process started by this plugin.\n\nRun `:Jqrun {args}` at any time to invoke jq manually with the jq arguments\n`{args}` and the current `jq-filter://` buffer. This will temporarily override\nthe jq options previously set when starting the session with `:Jqplay {args}`.\nAdd a bang to `:Jqrun!` to permanently override the options for the\n`jq-filter://` buffer.\n\n`:Jqrun` is useful to quickly run the same jq filter with different set of jq\noptions, without closing the session. Alternatively, if you don't want to run jq\ninteractively on every buffer change, disable all autocommands and use `:Jqrun`\ninstead.\n\n### `:JqplayScratch`\n\nThis command is like `:Jqplay` but starts an interactive jq session with a new\nscratch buffer as input.\n\n### `:JqplayScratchNoInput`\n\nOpens an interactive session with a new jq filter buffer but without using any\ninput buffer. It always passes `-n/--null-input` to jq. This command is useful\nwhen you don't need any input file passed to jq.\n\n\n## Configuration\n\nOptions can be set through the dictionary variable `g:jqplay`. The following\nentries are supported:\n\n| Key        | Description                                                      | Default                          |\n| ---------- | ---------------------------------------------------------------- | -------------------------------- |\n| `exe`      | Path to jq executable.                                           | value found in `$PATH`           |\n| `opts`     | Default jq command-line options (e.g. `--tab`).                  | -                                |\n| `autocmds` | Events when jq is invoked.                                       | `['InsertLeave', 'TextChanged']` |\n| `delay`    | Time in ms after which jq is invoked when an event is triggered. | `500`                            |\n\n### Examples\n\n1. Use the local jq executable, and tabs for indentation. Invoke jq whenever\n   insert mode is left, or text is changed in either insert or normal mode.\n   ```vim\n   g:jqplay = {\n       exe: '~/.local/bin/jq',\n       opts: '--tab',\n       autocmds: ['TextChanged', 'TextChangedI', 'InsertLeave']\n   }\n   ```\n2. Use tabs for indentation, do not run jq automatically on buffer change.\n   Instead invoke jq manually with `:Jqrun`:\n   ```vim\n   g:jqplay = {opts: '--tab', autocmds: []}\n   ```\n\n\n## Installation\n\n```bash\n$ cd ~/.vim/pack/git-plugins/start\n$ git clone --depth=1 https://github.com/bfrg/vim-jqplay\n$ vim -u NONE -c 'helptags vim-jqplay/doc | quit'\n```\n**Note:** The directory name `git-plugins` is arbitrary, you can pick any other\nname. For more details see `:help packages`. Alternatively, use your favorite\nplugin manager.\n\n\n## Related plugins\n\n[vim-jq][vim-jq] provides Vim runtime files like syntax highlighting for jq\nscript files.\n\n\n## License\n\nDistributed under the same terms as Vim itself. See `:help license`.\n\n[jq]: https://github.com/stedolan/jq\n[jqplay]: https://jqplay.org\n[vim-jq]: https://github.com/bfrg/vim-jq\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfrg%2Fvim-jqplay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfrg%2Fvim-jqplay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfrg%2Fvim-jqplay/lists"}