https://github.com/urbainvaes/vim-remembrall
For forgetful vim users
https://github.com/urbainvaes/vim-remembrall
vim
Last synced: about 1 year ago
JSON representation
For forgetful vim users
- Host: GitHub
- URL: https://github.com/urbainvaes/vim-remembrall
- Owner: urbainvaes
- License: mit
- Created: 2018-03-18T01:50:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-09-10T07:46:37.000Z (almost 5 years ago)
- Last Synced: 2025-03-25T09:47:41.151Z (about 1 year ago)
- Topics: vim
- Language: Vim script
- Size: 365 KB
- Stars: 131
- Watchers: 5
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Remembrall
This is a small plugin that makes it easier to remember mappings.
## Installation
Using [vim-plug](https://github.com/junegunn/vim-plug):
```vim
Plug 'urbainvaes/vim-remembrall'
```
## Usage

To scroll down and up the list, use ``, ``, or (pagewise) `` and ``.
Adding support for a prefix can be achieved via mappings in your `.vimrc`:
```vim
" Show ',' normal mode mappings when ',' is pressed.
nnoremap , Remembrall(',')
" Show ',' normal mode mappings when the key combination ',?' is pressed,
" so we don't have to wait for the timeout.
nnoremap ,? Remembrall(',')
" Show visual mode mappings.
vnoremap ? Remembrall('v', '')
```
Remembrall defines a mapping for the all the prefixes in the list `g:remembrall_normal_keys`,
which defaults to *c, d, g, y, ], [, >, <, =, \* and *\*.
A list of suffixes,
which will be appended to the left-hand side in the definition of the mappings,
can be defined with `g:remembrall_suffixes`.
For example, if this list is set to `["?"]`,
then the plugin will append the character `?` in the left-hand side of all the mappings it defines.
The relevant part of the plugin code should make this clear:
```vim
for suffix in s:suffixes
for key in s:normal_keys
silent execute "nnoremap " key.suffix "Remembrall('".key."')"
endfor
endfor
```
To avoid the timeout between a key press and the moment Remembrall opens,
the argument `` can be used in the definition of the corresponding mapping.
The following mapping, for example,
will force Remembrall to open directly when the default `vimtex` prefix,
`l`, is pressed in a `tex` buffer:
```vim
augroup remembrall
autocmd FileType tex nnoremap l Remembrall(',l')
augroup END
```
## Customization
| Config | Default | Description |
| ------ | ------- | ----------- |
| `g:remembrall_normal_keys` | See above | Keys for which to enable Remembrall |
| `g:remembrall_suffixes` | [""] | List of suffixes |
| `g:remembrall_window` | `topleft 30new` | Command for creating Remembrall window |
| `g:remembrall_zoom` | `\` | Key to toggle zoom |
| `g:remembrall_search` | `1` | Enable search using `/` |
| `g:remembrall_auto_accept` | `1` | Automically accept unique match |
| `g:remembrall_accept` | `\` | Key to accept a mapping when auto-accept is disabled |
## Acknowledgements
Some parts of the source code were inspired by [vim-peekaboo](https://github.com/junegunn/vim-peekaboo).
I thank Raimond Willemsen for reporting bugs and suggesting improvements.
## License
MIT