{"id":13683621,"url":"https://github.com/sunaku/vim-shortcut","last_synced_at":"2025-08-20T20:11:21.546Z","repository":{"id":66274277,"uuid":"42825196","full_name":"sunaku/vim-shortcut","owner":"sunaku","description":"💇 Discoverable \u0026 searchable shortcuts for (Neo)Vim","archived":false,"fork":false,"pushed_at":"2022-03-26T15:54:17.000Z","size":535,"stargazers_count":189,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T07:47:03.963Z","etag":null,"topics":["fallback-shortcuts","shortcut-menu","vim-plugins"],"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/sunaku.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}},"created_at":"2015-09-20T18:56:43.000Z","updated_at":"2025-03-14T02:09:54.000Z","dependencies_parsed_at":"2023-05-01T18:35:29.984Z","dependency_job_id":null,"html_url":"https://github.com/sunaku/vim-shortcut","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/sunaku/vim-shortcut","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaku%2Fvim-shortcut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaku%2Fvim-shortcut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaku%2Fvim-shortcut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaku%2Fvim-shortcut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunaku","download_url":"https://codeload.github.com/sunaku/vim-shortcut/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunaku%2Fvim-shortcut/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271378641,"owners_count":24749188,"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-08-20T02:00:09.606Z","response_time":69,"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":["fallback-shortcuts","shortcut-menu","vim-plugins"],"created_at":"2024-08-02T13:02:19.335Z","updated_at":"2025-08-20T20:11:21.516Z","avatar_url":"https://github.com/sunaku.png","language":"Vim script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"# shortcut.vim\n\nThis plugin provides a _discoverable_ shortcut system for Vim that is inspired\nby [Spacemacs] and powered by [fzf.vim].  It displays a searchable menu of\nshortcuts when you pause partway while typing a shortcut, say, because you\nforgot the rest of it or because you just want to see the shortcut menu again\nto discover what else is available.  You can interactively filter the menu by\ntyping more shortcut keys or parts of shortcut descriptions shown in the menu.\n\n[![asciicast](https://asciinema.org/a/104572.png)](https://asciinema.org/a/104572?autoplay=1)\n\n## Requirements\n\n* [fzf.vim] plugin.\n\n## Installation\n\n1. Clone this Git repository as follows, or [download and extract its\n   contents]( https://github.com/sunaku/vim-shortcut/archive/master.zip ).\n\n        git clone https://github.com/sunaku/vim-shortcut.git ~/vim-shortcut\n\n2. Run the following commands in Vim to start using this plugin immediately,\n   or add them to your *vimrc* file to automate this whenever you start Vim.\n\n        :set runtimepath+=~/vim-shortcut\n        :runtime plugin/shortcut.vim\n\n3. Run the following command inside Vim to learn more about using this plugin.\n\n        :help shortcut.vim\n\n## Usage\n\n* Use the `Shortcut!` prefix (with a bang) to describe existing shortcuts.\n\n* Use the `Shortcut` prefix (without a bang) to define brand new shortcuts.\n\n* Use the `:Shortcuts` command to display a searchable menu of shortcuts.\n\n* Use the `g:shortcuts` variable to access shortcuts keys and descriptions.\n\n* Use the `g:shortcuts_overwrite_warning` variable to detect any conflicts.\n\n### Discovery \u0026 fallback shortcuts\n\nI recommend that you define these two shortcuts for discovery and fallback\n(feel free to change the `\u003cLeader\u003e` key to your own commonly used prefix):\n\n```vim\nShortcut show shortcut menu and run chosen shortcut\n      \\ noremap \u003csilent\u003e \u003cLeader\u003e\u003cLeader\u003e :Shortcuts\u003cReturn\u003e\n\nShortcut fallback to shortcut menu on partial entry\n      \\ noremap \u003csilent\u003e \u003cLeader\u003e :Shortcuts\u003cReturn\u003e\n```\n\nThe fallback shortcut's keys should represent the common prefix used by most\nof your shortcuts so that it can automatically launch the shortcut menu for\nyou when you pause partway while typing a shortcut, say, because you forgot\nthe rest of it or because you just want to see the shortcut menu again to\ndiscover what else is available.  However, this is not a strict requirement\nbecause you might find it useful to map shortcuts with uncommon prefixes when\nyou know them by heart and you thereby feel that a fallback is unnecessary.\nAs a result, you can map any keys to any shortcut, regardless of the prefix!\nFurthermore, you can set up multiple fallback shortcuts too, one per prefix.\n\n### Describing existing shortcuts\n\nUse `Shortcut!` with a bang to describe shortcuts that are already defined:\n\n```vim\nShortcut! keys description\n```\n\nFor more examples, [see my vimrc](\nhttps://github.com/sunaku/.vim/blob/qwerty/bundle/motion/unimpaired.vim\n):\n\n```vim\nShortcut! [f       go to previous file in current file's directory\nShortcut! ]f       go to next     file in current file's directory\n```\n\nAny extra whitespace is ignored.\n\n### Defining new shortcuts\n\nSimply prefix any existing `map` command with `Shortcut` and a description.\n\nFor example, take this mapping:\n\n```vim\nmap definition\n```\n\nAdd `Shortcut` and description:\n\n```vim\nShortcut description map definition\n```\n\nYou can use multiple lines too:\n\n```vim\nShortcut description\n      \\ map definition\n```\n\nFor more examples, [see my vimrc](\nhttps://github.com/sunaku/.vim/blob/qwerty/plugin/format.vim\n):\n\n```vim\nShortcut duplicate before cursor and then comment-out\n      \\ map \u003cSpace\u003ecP  \u003cPlug\u003eNERDCommenterYank`[P\n```\n\n```vim\nShortcut fzf files in directory and go to chosen file\n      \\ nnoremap \u003csilent\u003e \u003cSpace\u003eef :Files\u003cReturn\u003e\n```\n\n```vim\nShortcut save file as...\n      \\ nnoremap \u003csilent\u003e \u003cSpace\u003eyf :call feedkeys(\":saveas %\\t\", \"t\")\u003cReturn\u003e\n```\n\n```vim\nfor i in range(1,9)\n  execute 'Shortcut go to tab number '. i .' '\n        \\ 'nnoremap \u003csilent\u003e \u003cSpace\u003e'. i .'t :tabfirst\u003cBar\u003e'. i .'tabnext\u003cReturn\u003e'\nendfor\n```\n\n```vim\nShortcut comment-out using FIGlet ASCII art decoration\n      \\ nnoremap \u003csilent\u003e \u003cSpace\u003ec@ V:call CommentUsingFIGlet()\u003cReturn\u003e\n      \\|vnoremap \u003csilent\u003e \u003cSpace\u003ec@ :\u003cC-U\u003ecall CommentUsingFIGlet()\u003cReturn\u003e\n\nfunction! CommentUsingFIGlet()\n  \" ...\nendfunction\n```\n\nAny extra whitespace is ignored.\n\n## Documentation\n\nRun `:help shortcut.vim` or see the `doc/shortcut.txt` file.\n\n## Testing\n\nDevelopers can run the [vim-vspec]( https://github.com/kana/vim-vspec ) tests:\n\n```sh\ngem install bundler         # first time\nbundle install              # first time\nbundle exec vim-flavor test # every time\n```\n\n## License\n\n[Spare A Life]: https://sunaku.github.io/vegan-for-life.html\n\u003e Like my work? 👍 Please [spare a life] today as thanks! 🐄🐖🐑🐔🐣🐟✨🙊✌  \n\u003e Why? For 💕 ethics, the 🌎 environment, and 💪 health; see link above. 🙇\n\nCopyright 2015 Suraj N. Kurapati \u003chttps://github.com/sunaku\u003e\n\nDistributed under [the same terms as Vim itself][LICENSE].\n\n[LICENSE]: http://vimdoc.sourceforge.net/htmldoc/uganda.html#license\n[Spacemacs]: http://spacemacs.org\n[fzf.vim]: https://github.com/junegunn/fzf.vim\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunaku%2Fvim-shortcut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunaku%2Fvim-shortcut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunaku%2Fvim-shortcut/lists"}