vim-remembrall


Ⅰ. 插件描述

For forgetful vim users

Ⅱ. 基本信息

创建日期:  2018-03-18
使用用户:  4
Github星:  128
插件作者:  Urbain Vaes

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'urbainvaes/vim-remembrall'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'urbainvaes/vim-remembrall'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'urbainvaes/vim-remembrall'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/urbainvaes/vim-remembrall

Ⅳ. 文档说明

# Remembrall

This is a small plugin that makes it easier to remember mappings.

Installation

Using vim-plug:

Plug 'urbainvaes/vim-remembrall'

Usage

To scroll down and up the list, use <c-e>, <c-y>, or (pagewise) <c-f> and <c-b>.
Adding support for a prefix can be achieved via mappings in your .vimrc:

" Show ',' normal mode mappings when ',' is pressed.
nnoremap <silent> <expr> , Remembrall(',')

" Show ',' normal mode mappings when the key combination ',?' is pressed,
" so we don't have to wait for the timeout.
nnoremap <silent> <expr> ,? Remembrall(',')

" Show visual mode mappings.
vnoremap <silent> <expr> ? 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, ], [, >, <, =, <Leader> and <LocalLeader>.
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:

    for suffix in s:suffixes
      for key in s:normal_keys
        silent execute "nnoremap <silent> <expr>" key.suffix "Remembrall('".key."')"
      endfor
    endfor

To avoid the timeout between a key press and the moment Remembrall opens,
the argument <nowait> 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,
<LocalLeader>l, is pressed in a tex buffer:

augroup remembrall
    autocmd FileType tex nnoremap <buffer> <nowait> <expr> <LocalLeader>l Remembrall(',l')
augroup END

Customization

ConfigDefaultDescription
g:remembrall_normal_keysSee aboveKeys for which to enable Remembrall
g:remembrall_suffixes[""]List of suffixes
g:remembrall_windowtopleft 30newCommand for creating Remembrall window
g:remembrall_zoom\<c-z>Key to toggle zoom
g:remembrall_search1Enable search using /
g:remembrall_auto_accept1Automically accept unique match
g:remembrall_accept\<c-m>Key to accept a mapping when auto-accept is disabled

Inspiration and thanks

Some parts of the source code were inspired by vim-peekaboo.
Many thanks to Raimond Willemsen for reporting bugs and suggesting improvements.

License

MIT

添加新评论