{"id":13410256,"url":"https://github.com/gennaro-tedesco/nvim-jqx","last_synced_at":"2025-04-06T13:11:57.633Z","repository":{"id":44490021,"uuid":"344514269","full_name":"gennaro-tedesco/nvim-jqx","owner":"gennaro-tedesco","description":"Populate the quickfix with json entries","archived":false,"fork":false,"pushed_at":"2024-05-31T01:26:20.000Z","size":904,"stargazers_count":312,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T16:23:55.931Z","etag":null,"topics":["lua","neovim"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gennaro-tedesco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-03-04T15:07:59.000Z","updated_at":"2025-03-28T14:46:36.000Z","dependencies_parsed_at":"2024-01-03T03:29:26.595Z","dependency_job_id":"67b219ac-337e-4185-adaf-3c1f7e94f3f1","html_url":"https://github.com/gennaro-tedesco/nvim-jqx","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gennaro-tedesco%2Fnvim-jqx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gennaro-tedesco%2Fnvim-jqx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gennaro-tedesco%2Fnvim-jqx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gennaro-tedesco%2Fnvim-jqx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gennaro-tedesco","download_url":"https://codeload.github.com/gennaro-tedesco/nvim-jqx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485290,"owners_count":20946398,"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":["lua","neovim"],"created_at":"2024-07-30T20:01:05.829Z","updated_at":"2025-04-06T13:11:57.580Z","avatar_url":"https://github.com/gennaro-tedesco.png","language":"Lua","funding_links":[],"categories":["Programming Languages Support","Lua","Text Editor Plugins"],"sub_categories":["(requires Neovim 0.5)","Diagnostics"],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cimg width=\"350\" height=\"300\" src=\"examples/logo.png\"\u003e\n  \u003cbr\u003e\n  nvim-jqx\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch2 align=\"center\"\u003e\n  \u003ca href=\"https://luarocks.org/modules/gennaro-tedesco/nvim-jqx\"\u003e\n    \u003cimg alt=\"luarocks\" src=\"https://img.shields.io/luarocks/v/gennaro-tedesco/nvim-jqx?logo=lua\u0026color=2aa198\u0026style=for-the-badge\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/gennaro-tedesco/nvim-jqx/releases\"\u003e\n    \u003cimg alt=\"releases\" src=\"https://img.shields.io/github/release/gennaro-tedesco/nvim-jqx?logo=neovim\u0026color=2aa198\u0026style=for-the-badge\"/\u003e\n  \u003c/a\u003e\n\u003c/h2\u003e\n\n\u003ch4 align=\"center\"\u003ePopulate the quickfix with json entries\u003c/h4\u003e\n\n\u003ch3 align=\"center\"\u003e\n  \u003ca href=\"#Installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#Usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#Customisation\"\u003eCustomisation\u003c/a\u003e •\n  \u003ca href=\"#Feedback\"\u003eFeedback\u003c/a\u003e\n\u003c/h3\u003e\n\nIf only one could easily browse and preview json files in neovim. Oh wait, `nvim-jqx` does just that!\n\n## Installation\n\nInstall it using your favourite plugin manager: for instance\n\n- with [lazy.nvim](https://github.com/folke/lazy.nvim)\n\n```lua\n{\n  \"gennaro-tedesco/nvim-jqx\",\n  event = {\"BufReadPost\"},\n  ft = { \"json\", \"yaml\" },\n},\n```\n\nNotice that `jq` is a prerequisite, as this plugin executes `jq` queries internally.\n\n## Usage\n\n`nvim-jqx` exposes two commands: `JqxList` and `JqxQuery`.\nOpen a json file and issue `JqxList`: the json is prettified and the quickfix window is populated with the first level keys. Press `X` on a key to query its values and show the results in a floating window; alternatively `\u003cCR\u003e` takes you to its location in the file.\n\n![JqxListdemo](https://user-images.githubusercontent.com/15387611/113495463-4bd24500-94f2-11eb-88b5-64c1ee965886.gif)\n\n`JqxList` also accepts an optional argument representing the json type you want to subselect: for example `JqxList number` populates the quickfix with entries of type number only, so do `JqxList string`, `JqxList boolean` and so forth, respectively: this is quite useful for big files where you want to have a quick peek at, say, some numerical values only or similar. For a full list of available types see `h: jqx-usage` or simply hit `\u003cTab\u003e` to show the autocomplete for available types.\n\nTo execute more complicated and generic `jq` commands use `JqxQuery` instead; the prompt helps autocomplete with the file keys for easy typing. Open a json file `test.json` and issue `JqxQuery \u003cmy-query\u003e`: this translates into `jq \".\u003cmy-query\u003e\" test.json` as shown below\n\n```\n# JqxQuery grammar\nJqxQuery friends[2].name\n\"Michael Marquez\"\n\n# jq equivalent\njq '.friends[2].name' test.json\n\"Michael Marquez\"\n```\n\n![JqxQuerydemo](https://user-images.githubusercontent.com/15387611/113495732-ab7d2000-94f3-11eb-8781-0497771b60a1.gif)\n\nDefault commands\n\n| command          | description                                       |\n| :--------------- | :------------------------------------------------ |\n| `JqxList`        | populate the quickfix window with json keys       |\n| `JqxList string` | populate the quickfix window with string values   |\n| `JqxQuery`       | executes a generic `jq` query in the current file |\n| `\u003cCR\u003e`           | go to key location in file                        |\n| X                | query values of key under cursor                  |\n| `\u003cEsc\u003e`          | close floating window                             |\n\nTry it out directly with `nvim examples/test.json -c JqxList`.\n\nFor more in-depth description and explanations check the documentation `:h nvim-jqx` and links therein.\n\n### Yaml files\n\n`nvim-jqx` works on `yaml` files too. It requires, however, to install [yq](https://github.com/kislyuk/yq). Try it out directly with `nvim examples/test.yaml -c JqxList`, or execute `JqxQuery` on a `yaml` file.\n\n\u003e ⚠️ this plugin works with the Python implementation of yq by @kislyuk, not to be confused\n\u003e with the Go implementation of yq by @mikefarah.\n\n## Customisation\n\nIf you prefer key-mappings rather than commands simply bind\n\n```\nnmap ... \u003cPlug\u003eJqxList\n```\n\nThe configurable options are exposed in [nvim-jqx/config.lua](https://github.com/gennaro-tedesco/nvim-jqx/blob/master/lua/nvim-jqx/config.lua) and can be overridden at will. For example, with `lazy.nvim` you can configure them as\n\n```lua\n{\n    \"gennaro-tedesco/nvim-jqx\",\n    ...\n    init = function()\n        local jqx = require(\"nvim-jqx.config\")\n        jqx.geometry.border = \"single\"\n        jqx.geometry.width = 0.7\n        ...\n\n        jqx.query_key = \"X\"         -- keypress to query jq on keys\n        jqx.sort = false            -- show the json keys as they appear instead of sorting them alphabetically\n        jqx.show_legend = true      -- show key queried as first line in the jqx floating window\n        jqx.use_quickfix = false    -- if you prefer the location list\n    end,\n}\n```\n\nWhy not automatically formatting your `json` files as you open them? Set up the autogroup\n\n```lua\n\nlocal jqx = vim.api.nvim_create_augroup(\"Jqx\", {})\nvim.api.nvim_clear_autocmds({ group = jqx })\nvim.api.nvim_create_autocmd(\"BufWinEnter\", {\n\tpattern = { \"*.json\", \"*.yaml\" },\n\tdesc = \"preview json and yaml files on open\",\n\tgroup = jqx,\n\tcallback = function()\n\t\tvim.cmd.JqxList()\n\tend,\n})\n```\n\n## Feedback\n\nIf you find this plugin useful consider awarding it a ⭐, it is a great way to give feedback! Otherwise, any additional suggestions or merge request is warmly welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgennaro-tedesco%2Fnvim-jqx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgennaro-tedesco%2Fnvim-jqx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgennaro-tedesco%2Fnvim-jqx/lists"}