{"id":19051985,"url":"https://github.com/benknoble/popsikey","last_synced_at":"2025-04-24T01:26:42.512Z","repository":{"id":70217118,"uuid":"275671840","full_name":"benknoble/popsikey","owner":"benknoble","description":"Turn vim mappings into popups","archived":false,"fork":false,"pushed_at":"2022-11-28T18:02:00.000Z","size":15,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T09:34:28.731Z","etag":null,"topics":["vim","vim-plugin"],"latest_commit_sha":null,"homepage":"","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/benknoble.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}},"created_at":"2020-06-28T21:33:34.000Z","updated_at":"2024-07-01T07:01:12.000Z","dependencies_parsed_at":"2023-03-11T08:19:02.055Z","dependency_job_id":null,"html_url":"https://github.com/benknoble/popsikey","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/benknoble%2Fpopsikey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fpopsikey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fpopsikey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benknoble%2Fpopsikey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benknoble","download_url":"https://codeload.github.com/benknoble/popsikey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250542853,"owners_count":21447782,"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":["vim","vim-plugin"],"created_at":"2024-11-08T23:20:24.966Z","updated_at":"2025-04-24T01:26:42.491Z","avatar_url":"https://github.com/benknoble.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# popsikey\n\n[![This project is considered experimental](https://img.shields.io/badge/status-experimental-critical.svg)](https://benknoble.github.io/status/experimental/)\n\nVim plugin that turns prefixed mappings into pop-up menus.\n\n## What is it?\n\nIf you have lots of vim mappings that relate to the same subject, you may have\n\"namespaced\" them by using a prefix.\n\nAs an example, suppose all of your git mappings start with `\u003cleader\u003eg`:\n\n- `\u003cleader\u003egg` is `:Gstatus`\n- `\u003cleader\u003egc` is `:Gcommit`\n\npopsikey provides an interface to automatically turn those mappings into a popup\nmenu when it's supported. With our example mappings, you would create this by\ndoing\n\n    call popsikey#register('\u003cleader\u003eg', [\n            \\ #{key: 'g', info: 'status', action: \":Gstatus\\\u003cCR\u003e\", flags: 'n'},\n            \\ #{key: 'c', info: 'commit', action: \":Gcommit\\\u003cCR\u003e\", flags: 'n'},\n            \\ ],\n            \\ {})\n\nSo, `\u003cleader\u003eg` pops up the menu of git mappings, which is a list of map keys\nand descriptions. You navigate with the usual keys (`j`, `k`, `\u003cEsc\u003e`,\n`\u003cEnter\u003e`).  But your mappings work--so  pressing `g` inside the popup will\ntrigger `:Gstatus` as a shortcut to navigating the menu.\n\nAnd, if your vim doesn't support popups yet, you'll get regular old mappings:\n\n    nnoremap \u003cleader\u003egg :Gstatus\u003cCR\u003e\n    nnoremap \u003cleader\u003egc :Gcommit\u003cCR\u003e\n\nThat means the experience is seamless everywhere.\n\n**Note** only global normal-mode mappings, without modifiers, are currently\nsupported.\n\n## How do I use it?\n\nInstall it, and then call `popsikey#register` (note that I used `const` and `-\u003e`\nmethods liberally in the code, so your vim will need to support those).\n\nThe `popsikey#register` function takes the following arguments:\n\n- `prefix`: the mapping prefix, like `\u003cleader\u003eg`\n- `maps`: a list of mapping dictionaries. Each must contain the following keys\n  (strings):\n  - `key`: the key on which to trigger the mapping (without the prefix)\n  - `info`: a short description of the action for this mapping\n  - `action`: the action to take (this will be fed to `feedkeys`, so you may\n    need double-quotes and backslash-escapes on special characters like `\u003cCR\u003e`)\n  - `flags`: a string of `feedkeys` flags. If `flags` would cause keys not be\n    mapped by `feedkeys` and popups are unavailable, the created mappings are\n    non-recursive. Otherwise, the mappings are recursive.\n- `opts`: a dictionary of options to pass to `popup_create` (see `:help\n  popup_create-arguments`). Merged with a default of\n```vim\n#{\n        \\ filter: 'popsikey#filter',\n        \\ callback: 'popsikey#callback',\n        \\ title: prefix,\n        \\ padding: [1,2,1,2],\n        \\ pos: 'topleft',\n        \\ line: 'cursor+1',\n        \\ col: 'cursor',\n        \\ }\n```\n\nDo not override `filter` or `callback`, or you will break the menu's\nkey-handlers.\n\nThis should be enough to get started with most setups. If you need more\ncustomization, check out `:help popsikey`.\n\n## What if I don't have prefixed mappings?\n\nThen this probably isn't going to be a plugin or a solution you need--after the\nfirst stroke of non-prefixed mapping, there's nothing left to \"popup.\"\n\nMost default keybindings are mnemonically named. I found that when creating my\nown keybindings, however, I often namespaced related operations together by\nusing a second prefix under leader and left general operations as single keys\nunder my leader.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenknoble%2Fpopsikey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenknoble%2Fpopsikey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenknoble%2Fpopsikey/lists"}