Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rBrda/myKeymap
A simple plugin to list and search key mappings in (neo)vim. Based on fzf.vim.
https://github.com/rBrda/myKeymap
fzf neovim neovim-plugin vim vim-plugins
Last synced: 3 months ago
JSON representation
A simple plugin to list and search key mappings in (neo)vim. Based on fzf.vim.
- Host: GitHub
- URL: https://github.com/rBrda/myKeymap
- Owner: rBrda
- License: mit
- Created: 2020-11-06T14:26:21.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-11T23:23:07.000Z (about 4 years ago)
- Last Synced: 2024-06-10T02:32:38.754Z (5 months ago)
- Topics: fzf, neovim, neovim-plugin, vim, vim-plugins
- Language: Vim script
- Homepage:
- Size: 8.79 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# myKeymap
A simple plugin to list and search key mappings in (neo)vim.
Based on [fzf.vim](https://github.com/junegunn/fzf.vim).
![mykeymap](https://user-images.githubusercontent.com/22145465/98745430-d84d6100-23b3-11eb-8c89-10869b23e458.png)
## Usage
Let's suppose you defined the following key mappings to navigate between open windows more easily. They look like this:
```vim
" Navigating between open windows
nnoremap l
nnoremap h
nnoremap k
nnoremap j
```With the help of this plugin you can add annotations to your key mappings. This way the plugin will be able to find them and list them for you.
```vim
" Navigating between open windows
" @(Windows -> right)
nnoremap l
" @(Windows -> left)
nnoremap h
" @(Windows -> up)
nnoremap k
" @(Windows -> down)
nnoremap j
```### How to add annotations to your key bindings?
The annotation must be placed just above the key mapping it belongs to, like this:
```vim
" @(Shift indentation)
vnoremap >gv
```
Use descriptive naming for your key mappings, this way it's easier to search them.Note: you must restart your editor whenever you added or modified the annotations of your key mappings!
### How to list and search your annotated key mappings?
The plugin has the `MyKeymap` command for listing the annotated key mappings. They will be shown in a fzf popup window.
## Installation
It requires [fzf.vim](https://github.com/junegunn/fzf.vim) to be installed!
With [vim-plug](https://github.com/junegunn/vim-plug):
```
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'rBrda/myKeymap'
```## Configuration
You can configure the plugin by setting the following global variable in your (neo)vim configuration file (here you see all the properties included that can be modified):
```vim
let g:myKeymapSettings = {
\ 'show_details': ['action'],
\ 'disable_cache': 0,
\ }
```### `g:myKeymapSettings.show_details`
Default value: `['action']`
Possible values: `['action', 'source']`
This is a list of details that can be shown in the result list about the key mapping.
Meaning of the available values:
* `action` : shows the mapped command of the key mapping
* `source` : shows the source file and line number of the key mapping### `g:myKeymapSettings.disable_cache`
Default value: `0`
If the cache is turned off (`1`), the plugin will always read your (neo)vim configuration files when the `MyKeymap` command is issued.