{"id":20616995,"url":"https://github.com/jungomi/vim-mdnquery","last_synced_at":"2025-09-09T06:08:38.196Z","repository":{"id":66148665,"uuid":"74857124","full_name":"jungomi/vim-mdnquery","owner":"jungomi","description":"Query the Mozilla Developer Network documentation without leaving Vim","archived":false,"fork":false,"pushed_at":"2017-03-21T08:35:16.000Z","size":314,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-31T09:35:33.638Z","etag":null,"topics":["docs","javascript","mdn","vim","vim-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Vim script","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/jungomi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-11-26T23:53:26.000Z","updated_at":"2022-05-09T08:29:24.000Z","dependencies_parsed_at":"2023-03-24T23:19:09.574Z","dependency_job_id":null,"html_url":"https://github.com/jungomi/vim-mdnquery","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jungomi/vim-mdnquery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jungomi%2Fvim-mdnquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jungomi%2Fvim-mdnquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jungomi%2Fvim-mdnquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jungomi%2Fvim-mdnquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jungomi","download_url":"https://codeload.github.com/jungomi/vim-mdnquery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jungomi%2Fvim-mdnquery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274250722,"owners_count":25249439,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docs","javascript","mdn","vim","vim-plugin"],"created_at":"2024-11-16T11:21:32.264Z","updated_at":"2025-09-09T06:08:38.173Z","avatar_url":"https://github.com/jungomi.png","language":"Vim script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vim-MdnQuery\n\nQuery the [Mozilla Developer Network][mdn] documentation without leaving Vim.\nThe network requests are done asynchronously if the job-control feature is\navailable (both in NeoVim and Vim), otherwise it falls back to using Ruby.\nTo avoid unnecessary requests, the search results and documentation entries are\ncached in the current Vim instance, which allows to switch quickly between them.\n\n![Demo][demo]\n\n## Requirements\n\n- NeoVim or Vim with the job-control feature for asynchronous execution.\n- Vim compiled with Ruby support when job-control is not available.\n- The gem [mdn_query][mdn_query].\n\n## Installation\n\n```sh\ngem install mdn_query\n```\n\nInstall the plugin with your favourite plugin manager.\n\n### Example using [vim-plug][vim-plug]\n\nAdd the following to `~/.vimrc` or `~/.config/nvim/init.vim` respectively:\n\n```vim\nPlug 'jungomi/vim-mdnquery'\n```\n\nReload the config file and install the plugins:\n\n```\n:source $MYVIMRC\n:PlugInstall\n```\n\n## Usage\n\n### Simple Search\n\n```\n:MdnQuery array remove\n```\n\nSearches for `array remove` and shows the list of results in a buffer when the\nsearch finishes. Inside the buffer you can open the entry under the cursor by\npressing `\u003cEnter\u003e`. When showing an entry you can press `r` to return to the\nlist of results.\n\nOften a search query is specific enough that the first result in the list is the\none that will be opened. Doing that manually would quickly become annoying and\nfor this reason `:MdnQueryFirstMatch` exists, which automatically opens the\nfirst entry.\n\n```\n:MdnQueryFirstMatch array.pop\n```\n\n### Keywordprg (K command)\n\nThe K command is used to lookup documentation for the word under the cursor. It\ndefaults to `man` on Unix and `:help` otherwise. The default behaviour is not\nvery useful for many file types. This plugin automatically changes that for\nJavaScript files . Pressing K in normal mode uses this plugin to search for the\nword under the cursor.\n\nIt might be useful to also have this behaviour for other file types, so you can\nuse a simple autocommand to set it for them:\n\n```vim\nautocmd FileType html setlocal keywordprg=:MdnQueryFirstMatch\n```\n\n*See `:help mdnquery-keyworprg` for more details.*\n\n### Topics\n\nThe search is limited to the topics specified in `g:mdnquery_topics`, which is\na list of topics and defaults to `['js']`. Having a global list of topics for\nall searches might show some undesired results. Instead of having to change the\nglobal option, you can set `b:mdnquery_topics`, which is local to the current\nbuffer and is used over the global one if it exists. This can easily be combined\nwith an autocommand to set the correct topics for a specific file type.\n\n```vim\n\" Search in JS and CSS topics\nlet g:mdnquery_topics = ['js', 'css']\n\" Search only for HTML in the current buffer\nlet b:mdnquery_topics = ['html']\n\n\" Automatically set the topics for HTML files\nautocmd FileType html let b:mdnquery_topics = ['css', 'html']\n```\n\nIf you would like to execute a search for specific topics without having to\nchange any settings, you can use the functions `mdnquery#search(query, topics)`\nand `mdnquery#firstMatch(query, topics)`.\n\n```vim\ncall mdnquery#search('link', ['css', 'html'])\ncall mdnquery#firstMatch('flex align', ['css'])\n```\n\n### Buffer appearance\n\nBy default the buffer appears after a search is completed and it is not\nautomatically focused. You can change this behaviour by changing the\n`g:mdnquery_show_on_invoke` and `g:mdnquery_auto_focus` settings. The buffer is\nopened with the `:botright` command and therefore appears at full width on the\nbottom of the screen or when `g:mdnquery_vertical` is set, it appears at full\nheight on the very right of the screen. The size of the buffer can be changed\nwith the `g:mdnquery_size` setting. For example to automatically show and focus\nthe window with a height of 10 lines, this configuration can be used:\n\n```vim\nlet g:mdnquery_show_on_invoke = 1\nlet g:mdnquery_auto_focus = 1\nlet g:mdnquery_size = 10\n```\n\nIf you prefer to only focus the buffer when a search is finished, you can use\nthe following autocommand instead of setting `g:mdnquery_auto_focus`:\n\n```vim\nautocmd User MdnQueryContentChange call mdnquery#focus()\n```\n\n*See `:help mdnquery-settings` for the full list of settings.*\n\n### Documentation\n\nFor additional and more detailed information take a look at the plugin's help.\n\n```vim\n:help mdnquery.txt\n```\n\n## Known Issues\n\n*Only for Vim versions without the job-control feature.*\n\n`LoadError: incompatible library version - Nokogiri`\n\nThis error occurs when using a Ruby installed with RVM but Vim was compiled with\nsystem ruby. To fix it tell RVM to use system Ruby and then reinstall the gem,\nor simply get a Vim version with job-control support.\n\n```sh\nrvm use system\ngem install mdn_query\n```\n\n[demo]: screenshots/demo.gif\n[mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript\n[mdn_query]: https://github.com/jungomi/mdn_query\n[vim-plug]: https://github.com/junegunn/vim-plug\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjungomi%2Fvim-mdnquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjungomi%2Fvim-mdnquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjungomi%2Fvim-mdnquery/lists"}