{"id":19267442,"url":"https://github.com/theblob42/idea-which-key","last_synced_at":"2025-04-21T19:32:56.370Z","repository":{"id":41745461,"uuid":"316599005","full_name":"TheBlob42/idea-which-key","owner":"TheBlob42","description":"IdeaVim extension that displays available keybindings in a popup","archived":false,"fork":false,"pushed_at":"2024-04-12T21:23:12.000Z","size":1431,"stargazers_count":153,"open_issues_count":7,"forks_count":12,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-13T05:11:05.187Z","etag":null,"topics":["ideavim","intellij","vim"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheBlob42.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2020-11-27T20:59:57.000Z","updated_at":"2024-04-14T22:33:10.717Z","dependencies_parsed_at":"2023-11-07T19:48:11.041Z","dependency_job_id":"6419cac2-18bb-45b2-8c26-22db373bf4a9","html_url":"https://github.com/TheBlob42/idea-which-key","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBlob42%2Fidea-which-key","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBlob42%2Fidea-which-key/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBlob42%2Fidea-which-key/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBlob42%2Fidea-which-key/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheBlob42","download_url":"https://codeload.github.com/TheBlob42/idea-which-key/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223876446,"owners_count":17218389,"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":["ideavim","intellij","vim"],"created_at":"2024-11-09T20:12:00.525Z","updated_at":"2025-04-21T19:32:56.361Z","avatar_url":"https://github.com/TheBlob42.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Version](https://img.shields.io/jetbrains/plugin/v/15976-idea-which-key.svg?style=flat-square)](https://plugins.jetbrains.com/plugin/15976-idea-which-key)\n\n# Which-Key\n\n[IdeaVim](https://github.com/JetBrains/ideavim) extension that displays available keybindings in a popup similar to [vim-which-key](https://github.com/liuchengxu/vim-which-key)\n\n![idea which key](./assets/idea_which_key.gif)\n\n\u003e Which-Key only displays **available** keybindings, it will not set them for you ([#44](https://github.com/TheBlob42/idea-which-key/issues/44), [#46](https://github.com/TheBlob42/idea-which-key/issues/46))  \n\u003e For a \"complete\" setup you might have a look at [intellimacs](https://github.com/MarcoIeni/intellimacs) (which was used for the GIF above)\n\n## Installation\n\n### JetBrains Marketplace\n\nInstall the plugin from the official [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/15976-idea-which-key)\n\nWithin Intellij go to *File -\u003e Settings -\u003e Plugins -\u003e Marketplace* search for \"Which Key\" and click on *Install*\n\n### Manual Installation\n\nTo build and install the plugin directly from source run the Gradle task `buildPlugin`\n\nAfterwards you find the built jar under `/build/libs`\n\nInstall the jar in Intellij via *File -\u003e Settings -\u003e Plugins -\u003e Install Plugin from Disk...*\n\n![install plugin from disk](/assets/manual_installation.png)\n\n### Activation\n\nSince this is an extension plugin for IdeaVim you have to activate it explicitly within your `.ideavimrc` file  \nFurthermore you should either disable the `timeout` option or increase the value for `timeoutlen`\n\n```vim\nset which-key\n\n\" disable the timeout option\nset notimeout\n\n\" increase the timeoutlen (default: 1000), don't add space around the equal sign\nset timeoutlen=5000\n```\n\n#### Explanation: `timeout` \u0026 `timeoutlen`\n\nBy default (Idea)VIM will wait for `timeoutlen` milliseconds after each key press of any unfinished mapping sequence before it cancels the whole sequence and processes each key press individually one after another. To match this behavior the IDEA-Which-Key popup will only be visible till a mapping sequence is either completed or canceled. Without any adaptions the popup is only displayed for a brief moment and will not be very useful. Therefore you should definitively modify `timout` or `timeoutlen` according to your preferences.\n\n\u003e IdeaVIM does not differentiate between `timeout`|`timeoutlen` and `ttimeout`|`ttimeoutlen`\n\n## Customization\n\nYou can customize several aspects of Which-Key via variables in your `.ideavimrc`\n\n\u003e Use the `:action IdeaVim.ReloadVimRc.reload` command to reload your config file\n\n### Descriptions\n\nIf no custom descriptions are defined, the right-hand side of all mappings will be displayed:\n\n![default popup](/assets/popup_default.png)\n\nTo provide custom names for prefixes and commands we need to configure one variable for every mapping:\n\n```vim\nlet g:WhichKeyDesc_windows        = \"\u003cSpace\u003ew  Windows\"\nlet g:WhichKeyDesc_windows_delete = \"\u003cSpace\u003ewd delete\"\nlet g:WhichKeyDesc_windows_split  = \"\u003cSpace\u003ews split below\"\n...\n```\n\nThe `\u003cleader\u003e` key is also supported:\n\n```vim\nlet g:WhichKeyDesc_windows_maximize = \"\u003cleader\u003ewm maximize\"\n```\n\n![configured popup](/assets/popup_configured.png)\n\nYou can also remove prefixes and mappings from being displayed at all by providing a blank custom description:  \n(this will **not** unmap them, it will just remove their appearance from the popup)\n\n```vim\nlet g:WhichKeyDesc_commentray_prefix = \"gc\"\nlet g:WhichKeyDesc_commentray_action = \"gcc\"\n```\n\nEvery variable's name has to start with `g:WhichKeyDesc_` in order to be recognized by the plugin. The rest of the variable name can be set to whatever fits best with you. For the value of each variable use the left-hand side of the mapping followed by at least one space or tab characters and finished with the description string you want to be displayed.\n\nOr if you prefer it in regular expressions:\n\n| Part  | Regex                          | Details                                                       |\n|-------|--------------------------------|---------------------------------------------------------------|\n| Name  | `g:WhichKeyDesc_[a-zA-Z0-9_]+` | the only valid characters for variable names are `a-zA-Z0-9_` |\n| Value | `([^ \\t]+)[ \\t]*(.*)`          | group one is the mapping, group two your description          |\n\nIf you are familiar with [vim-which-key](https://github.com/liuchengxu/vim-which-key) or the emacs package [which-key](https://github.com/justbur/emacs-which-key) this handling seems odd and very inconvenient, as it requires a lot of variable definitions and therefore a lot of repetition. Unfortunately this is the case because the IdeaVim plugin only supports the following four types of variables:\n\n- single quoted string\n- double quoted string\n- decimal number\n- reference to another variable\n\nDue to this limitation and the lack of any more convenient data types (array, list, dictionary, etc.) there is currently no \"nicer\" way of handling custom descriptions.\n\n\u003e As of writing the current versions are Intellij 2020.3 and IdeaVim 0.64\n\n### VIM Actions\n\nBy default Which-Key will only display key mappings which are defined in the `.ideavimrc` file. If you wish it can also display default VIM actions like `gg`, `zz`, `zt`, `\u003cC-w\u003ek`, etc. in the popup. For this you need to set the following variable within your `.ideavimrc`:\n\n```vim\nlet g:WhichKey_ShowVimActions = \"true\"\n```\n\nIf you wish you can also add custom descriptions for VIM Actions the same way as for other key mappings:\n\n```vim\nlet g:WhichKeyDesc_goto_top = \"gg goto first line\"\n```\n\n### Typed Keys\n\nAt the bottom of the popup you can see the keys you have typed so far as well as the current prefix description\n\nYou can hide this by adding the following to your `.ideavimrc`:\n\n```vim\nlet g:WhichKey_ShowTypedSequence = \"false\"\n```\n\n### Delay\n\nIn order to prevent the popup from \"flickering\" on fast consecutive key presses, there is a default delay of 200ms before it appears\n\nYou can configure this value so the popup appears faster or slower after a key press. The unit for the delay is milliseconds (ms):\n\n```vim\n\" make the popup show up 'instantly'\nlet g:WhichKey_DefaultDelay = 0\n\n\" make the popup appear much slower\nlet g:WhichKey_DefaultDelay = 600\n```\n\n### On Unknown Mapping\n\nWith the popup open pressing any key that is not mapped to any further prefix or action will close it and process all typed keys individually with their default actions\n\nIf you prefer to just close the popup without any further processing you can configure this:\n\n```vim\n\" close the popup and don't process formerly typed keys\nlet g:WhichKey_ProcessUnknownMappings = \"false\"\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCaveats\u003c/b\u003e\u003c/summary\u003e\n\n##### Insert Mode\n\nThis will never block insert mode mappings in order to enable mappings like `imap jk \u003cEsc\u003e` without interfering with characters you actually want to type. It also should¹ not interfere with operator commands or motions which are not \"real\" mappings like `hjkl`, `d`, `f`, etc.\n\n¹*If you encounter any weird behavior please open an issue, as there might be edge cases not covered yet*\n\n##### Ending On A Special Key\n\nIf you end your \"unknown key sequence\" on a special key (`\u003cEsc\u003e`, `\u003cTab\u003e`, any combination with `Control`, `Alt` etc.) this option will not work as expected and your previous keys will still be executed. The reason is that Which-Key can't intercept those key presses and does not realize that it should not process any previous keys. See also the [Known Issues](#known-issues) section for more information on the matter\n\u003c/details\u003e\n\n### Order\n\nBy default all elements of the popup are ordered alphabetically by the key you have to press.\n\nYou can change this by setting the value for the variable `g:WhichKey_SortOrder` to one of the following options:\n\n| Value                 | Description                                                                    |\n|-----------------------|--------------------------------------------------------------------------------|\n| `by_key`              | Sort all elements alphabetically by their key (default)                        |\n| `by_key_prefix_first` | Same as `by_key` but all prefix entries are ordered before any command mapping |\n| `by_key_prefix_last`  | Same as `by_key` but all prefix entries are ordered after any command mapping  |\n| `by_description`      | Sort all elements alphabetically by their description                          |\n\nNote that by default all order is based on case-sensitive sorting (so `Z` comes before `a`).\n\nYou can change this default by setting the `g:WhichKey_SortCaseSensitive` variable to `false` (default: `true`).\n\n```vim\n\" set how the elements should be ordered\nlet g:WhichKey_SortOrder = \"by_key_prefix_first\"\n\n\" set if the sorting should be case-sensitive or not\nlet g:WhichKey_SortCaseSensitive = \"false\"\n```\n\n### Appearance\n\nYou can configure the appearance of certain UI elements by setting the following options:\n\n| Variable                  | Description                            | Values                                                                                       | Default Value |\n|---------------------------|----------------------------------------|----------------------------------------------------------------------------------------------|---------------|\n| `g:WhichKey_Divider`      | String to separate key and description | any string                                                                                   | ` → `         |\n| `g:WhichKey_FontFamily`   | Font to use for the popup              | CSS `font-family` (see [examples](https://www.w3schools.com/cssref/pr_font_font-family.asp)) | `monospace`   |\n| `g:WhichKey_FontSize`     | Font size for the popup                | Font size in `point` (for example `15`, `22`, etc.)                                          | IDE default³  |\n| `g:WhichKey_KeyStyle`     | Font style for the keys                | `bold`, `italic`, `none`                                                                     | `bold`        |\n| `g:WhichKey_KeyColor`     | Font color for the keys                | hex code or color keyword\u003cbr/\u003e(`default`¹, `keyword`², \"red\", \"blue\", etc.)                  | `default`     |\n| `g:WhichKey_PrefixStyle`  | Font style for the prefixes            | `bold`, `italic`, `none`                                                                     | `none`        |\n| `g:WhichKey_PrefixColor`  | Font color for the prefixes            | hex code or color keyword\u003cbr/\u003e(`default`¹, `keyword`², \"red\", \"blue\", etc.)                  | `keyword`     |\n| `g:WhichKey_CommandStyle` | Font style for the commands            | `bold`, `italic`, `none`                                                                     | `none`        |\n| `g:WhichKey_CommandColor` | Font color for the commands            | hex code or color keyword\u003cbr/\u003e(`default`¹, `keyword`², \"red\", \"blue\", etc.)                  | `default`     |\n\n¹`default`: the default foreground color of the currently used theme  \n²`keyword`: the color for \"keywords\" of the currently used theme  \n³Uses the IDE default value for the font size (without any configuration this should be `15`)\n\n## Known Issues\n\nThe way the plugin injects itself into the flow of IdeaVIM to provide its features is a little \"hacky\" and you might encounter some inconsistencies. If you encounter anything not documented open an issue so we can check and maybe fix it. These are the ones that I am aware of\n\n### Special Prefixes\n\nConsider the following mapping sequence example which contains a modified key press (`\u003cC-a\u003e`) within:\n\n\u003e What the mapping does is not important for the example\n\n```text\nnoremap g\u003cC-a\u003ebc ...\n```\n\nIf you are about to activate this mapping the following will happen:\n\n| Press   | What will happen                                   |\n| ---     | ---                                                |\n| `g`     | The popup will appear and show `\u003cC-a\u003e` as a prefix |\n| `\u003cC-a\u003e` | The popup will close itself                        |\n| `b`     | The popup will reopen and show `c` as a command    |\n| `c`     | This will close the popup and execute your mapping |\n\n\nThe reason for this is that we currently have no way to intercept modified \u0026 special key presses like `\u003cC-a\u003e`, `\u003cEsc\u003e`, `\u003cA-a\u003e` etc. Vim internal actions like `\u003cC-d\u003e` or `\u003cC-o\u003e` are handled as a custom action instead of being processed by a general handler like \"regular\" key presses\n\nIf you have more knowledge about the internals of IdeaVIM in this regard or have another idea how to solve this issue, please open an issue or PR\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheblob42%2Fidea-which-key","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheblob42%2Fidea-which-key","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheblob42%2Fidea-which-key/lists"}