Ⅰ. 插件描述
Toggle relative line numbers with ease.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'kennykaye/vim-relativity'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'kennykaye/vim-relativity'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'kennykaye/vim-relativity'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/kennykaye/vim-relativity
Ⅳ. 文档说明
vim-relativity
Toggle relative line numbers with ease.
Demo

Installation
Please use your favorite plugin manager.
Using vim-plug:
Plug 'kennykaye/vim-relativity'Commands
| Command | Description |
|---|---|
:Relativity | Toggle Relativity on/off |
:Relativity! | Turn Relativity off |
Options
| Option | Default | Description |
|---|---|---|
g:relativity_insert_toggle | 1 | Enables toggling on InsertEnter and InsertLeave. |
g:relativity_focus_toggle | 1 | Enables toggling on FocusEnter and FocusLeave. |
g:relativity_current_absolute | 1 | Displays absolute line number for current line. |
g:relativity_enabled_on_start | 1 | Enable Relativity automatically when vim starts. |
g:relativity_buftype_ignore | ['nofile'] | A list of buffer types to disable toggling for. |
g:relativity_filetype_ignore | ['controlp', 'nerdtree', 'fugitive', 'tagbar', 'agsv', 'fzf'] | A list of filetypes to disable toggling for. |
Inspiration
Inspired by numbers.vim and vim-numbertoggle
License
MIT