{"id":13898731,"url":"https://github.com/dpretet/vim-leader-mapper","last_synced_at":"2025-07-12T06:02:09.932Z","repository":{"id":53026059,"uuid":"227066271","full_name":"dpretet/vim-leader-mapper","owner":"dpretet","description":"Vim plugin to create Neovim leader key menu","archived":false,"fork":false,"pushed_at":"2023-12-09T13:00:03.000Z","size":28,"stargazers_count":42,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-07T18:47:43.891Z","etag":null,"topics":["fzf","leader-key","neovim","nvim","vim-leader-mapper","vim-plugin","vim-script","viml"],"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/dpretet.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":"2019-12-10T08:27:00.000Z","updated_at":"2024-07-01T08:15:42.000Z","dependencies_parsed_at":"2023-01-30T20:30:23.703Z","dependency_job_id":null,"html_url":"https://github.com/dpretet/vim-leader-mapper","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpretet%2Fvim-leader-mapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpretet%2Fvim-leader-mapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpretet%2Fvim-leader-mapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpretet%2Fvim-leader-mapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpretet","download_url":"https://codeload.github.com/dpretet/vim-leader-mapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226281053,"owners_count":17599743,"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":["fzf","leader-key","neovim","nvim","vim-leader-mapper","vim-plugin","vim-script","viml"],"created_at":"2024-08-06T18:04:25.872Z","updated_at":"2024-11-25T05:30:27.957Z","avatar_url":"https://github.com/dpretet.png","language":"Vim Script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"# vim-leader-mapper\n\n## Introduction\n\nVim-Leader-Mapper is a plugin to create leader key mapping and a visual\nmenu to display them. It's basically a copy of Spacemacs interactive menu,\nrelying on leader key to toggle it.\n\n- Easy to use: the user can simply add his own commands with few setup and map\n  them to leader key.\n- Configurable: the user can associate any command (internal or external command).\n- Fast: the plugin is very small, written in pure vimL.\n\nIt's also inspired from\n[vim-leader-guide](https://github.com/hecal3/vim-leader-guide) but it's simpler\nand use floating window to display leader menu.\n\n[Vim-which-key](https://github.com/liuchengxu/vim-which-key) offers similar\nfeatures.\n\n## Installation\n\nUse [Vim-Plug](https://github.com/junegunn/vim-plug) or any other plugin\nmanager to install it.\n\n```vim\nPlug 'dpretet/vim-leader-mapper'\n```\n\n## Configuration\n\nFollows a configuration example, binding regular Vim commands and FZF calls:\n\n```vim\n\n\" Define the menu content with a Vim dictionary\nlet g:leaderMenu = {'name':  \"\",\n             \\'f': [\":Files\",       \"FZF file search\"],\n             \\'b': [\":Buffers\",     \"FZF buffer search\"],\n             \\'s': [\":BLines\",      \"FZF text search into current buffer\"],\n             \\'S': [\":Lines\",       \"FZF text search across loaded buffers\"],\n             \\'g': [\":BCommits\",    \"FZF git commits of the current buffer\"],\n             \\'G': [\":Commits\",     \"FZF git commits of the repository\"],\n             \\'v': [':vsplit',      'Split buffer vertically'],\n             \\'h': [':split',       'Split buffer horizontally'],\n             \\'d': [':bd',          'Close buffer'],\n             \\'r': [':so $MYVIMRC', 'Reload vimrc without restarting Vim'],\n             \\'l': [':ls',          'List opened buffers'],\n             \\'t': [':Tags',        'FZF tag search'],\n             \\'o': [':normal gf',   'Open file under cursor'],\n             \\}\n```\n\nFinally to bind leader key to space and toggle the menu on each space pressure:\n\n```vim\n\" Define leader key to space and call vim-leader-mapper\nnnoremap \u003cSpace\u003e \u003cNop\u003e\nlet mapleader = \"\\\u003cSpace\u003e\"\nnnoremap \u003csilent\u003e \u003cleader\u003e :LeaderMapper \"\u003cSpace\u003e\"\u003cCR\u003e\nvnoremap \u003csilent\u003e \u003cleader\u003e :LeaderMapper \"\u003cSpace\u003e\"\u003cCR\u003e\n```\n\nOne could want to specify the position of the window. This can be done with two\nparameters.\n\nTo define the vertical placement of the window. Can be `top`, `bottom` or\n`center` (default is `center`):\n\n```vim\nlet g:leaderMapperPos = \"center\"\n```\n\nTo define the window's width, in percentage of the Vim window (default is\n`70%`):\n\n```vim\nlet g:leaderMapperWidth = 70\n```\n\n\nIt's also possible to add submenu binded with a key. Here is an example:\n\n```vim\n\n\" Define the menu dedicated to FZF\nlet fzfMenu = {'name':  \"FZF Menu\",\n             \\'f': [\":Files\",    \"FZF file search\"],\n             \\'b': [\":Buffers\",  \"FZF buffer search\"],\n             \\'s': [\":BLines\",   \"FZF text search into current buffer\"],\n             \\'S': [\":Lines\",    \"FZF text search across loaded buffers\"],\n             \\'g': [\":BCommits\", \"FZF git commits of the current buffer\"],\n             \\'G': [\":Commits\",  \"FZF git commits of the repository\"],\n             \\}\n\n\" Define the menu content including the above menu\nlet g:leaderMenu = {'name':  \"Global Menu\",\n             \\'f': [fzfMenu,        \"FZF menu\"],\n             \\'v': [':vsplit',      'Split buffer vertically'],\n             \\'h': [':split',       'Split buffer horizontally'],\n             \\'d': [':bd',          'Close buffer'],\n             \\'r': [':so $MYVIMRC', 'Reload vimrc without restarting Vim'],\n             \\'l': [':ls',          'List opened buffers'],\n             \\'t': [':Tags',        'FZF tag search'],\n             \\'o': [':normal gf',   'Open file under cursor'],\n             \\}\n```\n\nPressing 'f' key will open the dedicated menu to FZF.\n\nIn case your function/command binded needs to access the lines range of a\nvisual selection, vim-leader-mapper setup two variables: `leaderMapperLineStart`\nand `leaderMapperLineEnd`. These variables are setup to line numbers as long the\nplugin is executed. When closing, it will setup them to `-1`.\n\n## License\n\nThis plugin is under MIT license. Do whatever you want with it, and don't\nhesitate to fork it and contribute!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpretet%2Fvim-leader-mapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpretet%2Fvim-leader-mapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpretet%2Fvim-leader-mapper/lists"}