{"id":28547071,"url":"https://github.com/skywind3000/quickmenu.vim","last_synced_at":"2025-07-07T07:32:12.702Z","repository":{"id":50636903,"uuid":"96881808","full_name":"skywind3000/quickmenu.vim","owner":"skywind3000","description":"A nice customizable popup menu for vim","archived":false,"fork":false,"pushed_at":"2024-09-12T08:39:25.000Z","size":28,"stargazers_count":279,"open_issues_count":7,"forks_count":12,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-06-10T00:09:07.455Z","etag":null,"topics":[],"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/skywind3000.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}},"created_at":"2017-07-11T10:34:13.000Z","updated_at":"2025-02-13T17:22:35.000Z","dependencies_parsed_at":"2022-09-01T16:20:56.447Z","dependency_job_id":null,"html_url":"https://github.com/skywind3000/quickmenu.vim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/skywind3000/quickmenu.vim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fquickmenu.vim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fquickmenu.vim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fquickmenu.vim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fquickmenu.vim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skywind3000","download_url":"https://codeload.github.com/skywind3000/quickmenu.vim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fquickmenu.vim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264034572,"owners_count":23547235,"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":[],"created_at":"2025-06-10T00:09:15.539Z","updated_at":"2025-07-07T07:32:12.697Z","avatar_url":"https://github.com/skywind3000.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Preface\r\n\r\nThere are many keymaps defined in my `.vimrc`. Getting tired to check my `.vimrc` again and again when I forget some, so I made this `quickmenu` plugin which can be fully customized:\r\n\r\n- Well formatted and carefully colored to ensure neat and handy.\r\n- Press `\u003cF12\u003e` to popup `quickmenu` on the right, use `j` and `k` to move up and down.\r\n- Press `\u003cEnter\u003e` or `1` to `9` to select an item.\r\n- `Help` details will display in the cmdline when you are moving the cursor around.\r\n- Items can be filtered by `filetype`, different items for different filetypes.\r\n- Scripts in the `%{...}` form from `text` and `help` will be evaluated and expanded.\r\n- No longer have to be afraid for forgetting keymaps.\r\n\r\nJust see this GIF demonstration below:\r\n\r\n![](https://skywind3000.github.io/images/p/quickmenu/menu-5.gif)\r\n\r\nTrying to share my configuration to my friends, I found that they did't have patience to remember all the keymaps in my vimrc, but a quickmenu is quite accaptable for them. \r\n\r\n**Note**: Active development on this plugin has stopped. The only future changes will be bug fixes.\r\n\r\nPlease see [vim-quickui](https://github.com/skywind3000/vim-quickui).\r\n\r\n\r\n## Install\r\n\r\nCopy `autoload/quickmenu.vim` and `syntax/quickmenu.vim` to your `~/.vim/autoload` and `~/.vim/syntax`. or use Vundle to install it from `skywind3000/quickmenu.vim`. Add these lines to your `.vimrc`:\r\n\r\n```VimL\r\n\" choose a favorite key to show/hide quickmenu\r\nnoremap \u003csilent\u003e\u003cF12\u003e :call quickmenu#toggle(0)\u003ccr\u003e\r\n\r\n\" enable cursorline (L) and cmdline help (H)\r\nlet g:quickmenu_options = \"HL\"\r\n```\r\n\r\n## Tutorial\r\n\r\nSimply use the function below:\r\n\r\n```VimL\r\nfunction quickmenu#append(text, action [, help = ''])\r\n```\r\n\r\n- `text` will be show in the quickmenu, vimscript in `%{...}` will be evaluated and expanded.\r\n- `action` is a piece of vimscript to be executed when a item is selected.\r\n- `help` will display in the cmdline if g:quickmenu_options contains `H`.\r\n\r\nA item will be treated as \"static text\" (unselectable) If `action` is empty. `text` starting with \"#\" represents a new section.\r\n\r\nExample for `.vimrc`:\r\n\r\n```\r\n\" enable cursorline (L) and cmdline help (H)\r\nlet g:quickmenu_options = \"LH\"\r\n\r\n\" clear all the items\r\ncall g:quickmenu#reset()\r\n\r\n\" bind to F12\r\nnoremap \u003csilent\u003e\u003cF12\u003e :call quickmenu#toggle(0)\u003ccr\u003e\r\n\r\n\r\n\" section 1, text starting with \"#\" represents a section (see the screen capture below)\r\ncall g:quickmenu#append('# Develop', '')\r\n\r\ncall g:quickmenu#append('item 1.1', 'echo \"1.1 is selected\"', 'select item 1.1')\r\ncall g:quickmenu#append('item 1.2', 'echo \"1.2 is selected\"', 'select item 1.2')\r\ncall g:quickmenu#append('item 1.3', 'echo \"1.3 is selected\"', 'select item 1.3')\r\n\r\n\" section 2\r\ncall g:quickmenu#append('# Misc', '')\r\n\r\ncall g:quickmenu#append('item 2.1', 'echo \"2.1 is selected\"', 'select item 2.1')\r\ncall g:quickmenu#append('item 2.2', 'echo \"2.2 is selected\"', 'select item 2.2')\r\ncall g:quickmenu#append('item 2.3', 'echo \"2.3 is selected\"', 'select item 2.3')\r\ncall g:quickmenu#append('item 2.4', 'echo \"2.4 is selected\"', 'select item 2.4')\r\n```\r\n\r\nAnd then quickmenu is ready:\r\n\r\n![](https://skywind3000.github.io/images/p/quickmenu/menu-6.gif)\r\n\r\nVim is lack of basic ui components, that's ok for experienced users, but hard for the others. A quickmenu is quite easier for them. Now we have this cute menu and show/hide it with F12. and no longer have to worry about  forgetting keymaps.\r\n\r\n\r\n## Documentation\r\n\r\n\r\n#### Add new items into menu\r\n\r\n```VimL\r\nfunction quickmenu#append(text, action [, help = '' [, ft = '']])\r\n```\r\n\r\n- `text` will be show in the quickmenu, vimscript in `%{...}` will be evaluated and expanded.\r\n- `action` is a piece of vimscript to be executed when a item is selected.\r\n- `help` will display in the cmdline if g:quickmenu_options contains `H`.\r\n- `ft` filter to decide if item is enabled for specific filetypes.\r\n\r\nA item will be treated as \"static text\" (unselectable) If `action` is empty. `text` starting with \"#\" represents a new section.\r\n\r\nNote that, script evaluation of `%{...}` is happened **before** quickmenu open, you can get  information from current document and display them in the menu, like current filename or word under cursor.\r\n\r\nAnd `action` will be executed **after** quickmenu closed. All the `action` will affect current document (not the quickmenu window).\r\n\r\nIf you want your item enabled for C/C++ set the parameter of `ft` to \"c,cpp,objc,objcpp\", otherwise just leave it empty.\r\n\r\n#### Clear items\r\n\r\n\r\n```VimL\r\nfunction quickmenu#reset()\r\n```\r\n\r\nThis will reset the quickmenu\r\n\r\n#### Set header\r\n\r\n```VimL\r\nfunction quickmenu#header(text)\r\n``` \r\n\r\nReplace the origin title of `QuickMenu X.X.X`\r\n\r\n#### Show / hide quickmenu\r\n\r\n```VimL\r\nfunction quickmenu#toggle(menuid)\r\n```\r\n\r\nYou have unlimited menus to use, not only one. The `menuid` is used to indicate which menu to be displayed. 0 can be used by default. \r\n\r\n#### Set current menuid\r\n\r\n```VimL\r\nfunction quickmenu#current(menuid)\r\n```\r\n\r\nIf current menu changed (which is 0 by default), `quickmenu#append()` will insert new items into the new menu and `quickmenu#reset()` will clear items in it either.\r\n\r\n#### Popup quickmenu on the bottom (cmdline)\r\n\r\n```VimL\r\nfunction quickmenu#bottom(menuid)\r\n```\r\n\r\nUse cmdline to show quickmenu.\r\n\r\n## Options\r\n\r\n#### g:quickmenu_padding_left (integer)\r\n\r\nLeft padding size of the quickmenu window\r\n\r\n```VimL\r\ndefault = 3\r\n```\r\n\r\nSet it to 2 or 1 if you are running vim in a small window, so quickmenu will not occupy much space.\r\n\r\n#### g:quickmenu_padding_right (integer)\r\n\r\nRight padding size of the quickmenu window\r\n\r\n```VimL\r\ndefault = 3\r\n```\r\n\r\nSet it to 2 or 1 if you are running vim in a small window, so quickmenu will not occupy much space.\r\n\r\n#### quickmenu_max_width (integer)\r\n\r\nMax quickmenu window size\r\n\r\n```VimL\r\ndefault = 40\r\n```\r\n\r\nWindow width of quickmenu is adaptive to the content of items. This control the max value of the window size.\r\n\r\n#### g:quickmenu_disable_nofile (integer)\r\n\r\nQuickmenu will not popup if `buftype` is \"nofile\" when set it to 1\r\n\r\n```VimL\r\ndefault = 1\r\n```\r\n\r\nPrevent quickmenu accidently popup in some non-file window like: quickfix, location list or tagbar, etc. whose `buftype` has been set to \"nofile\".\r\n\r\n\r\n#### g:quickmenu_ft_blacklist (list)\r\n\r\nQuickmenu will not popup if current `filetype` matchs the blacklist.\r\n\r\n```VimL\r\ndefault = ['netrw', 'nerdtree', 'startify']\r\n```\r\n\r\nIt is not enough to use `g:quickmenu_disable_nofile` to detect non-file buffers, some plugins like netrw forgot to set their `buftype` to \"nofile\".\r\n\r\n#### g:quickmenu_options (string)\r\n\r\nQuickmenu gui options, each character represents a feature.\r\n\r\n```VimL\r\ndefault = ''\r\n```\r\n\r\nThe available options are `\"H\"` (show help in the cmdline), `\"L\"` (show cursorline) and `\"T\"` (open on the left).\r\n\r\n\r\n\r\n## Example\r\n\r\nThe configuration for the first GIF screencapture: \r\n\r\n```VimL\r\n\r\n\" clear all the items\r\ncall quickmenu#reset()\r\n\r\n\" enable cursorline (L) and cmdline help (H)\r\nlet g:quickmenu_options = \"HL\"\r\n\r\n\" use your favorite key to show / hide quickmenu\r\nnoremap \u003csilent\u003e\u003cF12\u003e :call quickmenu#toggle(0)\r\n\r\n\r\n\" new section: empty action with text starts with \"#\" represent a new section\r\ncall quickmenu#append(\"# Debug\", '')\r\n\r\n\" script between %{ and } will be evaluated before menu open\r\ncall quickmenu#append(\"Run %{expand('%:t')}\", '!./%', \"Run current file\")\r\n\r\n\r\n\" new section\r\ncall quickmenu#append(\"# Git\", '')\r\n\r\n\" use fugitive to show diff\r\ncall quickmenu#append(\"git diff\", 'Gvdiff', \"use fugitive's Gvdiff on current document\")\r\n\r\ncall quickmenu#append(\"git status\", 'Gstatus', \"use fugitive's Gstatus on current document\")\r\n\r\n\r\n\" new section\r\ncall quickmenu#append(\"# Misc\", '')\r\n\r\ncall quickmenu#append(\"Turn paste %{\u0026paste? 'off':'on'}\", \"set paste!\", \"enable/disable paste mode (:set paste!)\")\r\n\r\ncall quickmenu#append(\"Turn spell %{\u0026spell? 'off':'on'}\", \"set spell!\", \"enable/disable spell check (:set spell!)\")\r\n\r\ncall quickmenu#append(\"Function List\", \"TagbarToggle\", \"Switch Tagbar on/off\")\r\n\r\n```\r\n\r\nFor more advanced usage, you may be interested in my own config:\r\n\r\nhttps://github.com/skywind3000/vim/blob/master/asc/menu.vim\r\n\r\n## More\r\n\r\nUltiSnips is great, but remembering all the snipet's names is really painful. There are more nearly 130+ snippets for C++ in UltiSnips's database, but I can remember only three of them. \r\n\r\nUsing quickmenu to select snippets is much easier for me than using UltiSnips directly, I am going to write a wiki page about it.\r\n\r\n## History\r\n\r\n- 1.2.4 (2017-08-08): supports funcref now.\r\n- 1.2.3 (2017-07-27): add `\u003cnowait\u003e` befor noremap to avoid delay when you press 'c'\r\n- 1.2.2 (2017-07-17): clear help text after pressing '0', remember cursor pos after closed.\r\n- 1.2.1 (2017-07-16): use redraw to clear help text in the cmdline after quickmenu closed.\r\n- 1.2.0 (2017-07-16): new feature `quickmenu#bottom` to popup on the bottom. \r\n- 1.1.16 (2017-07-15): improve unicode character support\r\n- 1.1.15 (2017-07-15): fixed: quickmenu will always popup on the right, no matter `splitright` is set or unset.\r\n- 1.1.14 (2017-07-14): fixed: incompatible with vim before 7.4.2202\r\n- 1.1.13 (2017-07-14): New option to set default left/right padding size, useful when running vim in a small window.\r\n- 1.1.12 (2017-07-13): Initial commit.\r\n\r\n## Credits\r\n\r\nThanks to [vim-startify](https://github.com/mhinz/vim-startify), quickmenu uses its syntax and some idea. \r\n\r\nIt is a great honor if you like it and star this repository or vote it in: [script #5589](http://www.vim.org/scripts/script.php?script_id=5589).\r\n\r\nIf you are interested in this plugin you may also like [AsyncRun](https://github.com/skywind3000/asyncrun.vim).\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskywind3000%2Fquickmenu.vim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskywind3000%2Fquickmenu.vim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskywind3000%2Fquickmenu.vim/lists"}