Ⅰ. 插件描述
Renumbering plugin for vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'clarke/vim-renumber'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'clarke/vim-renumber'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'clarke/vim-renumber'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/clarke/vim-renumber
Ⅳ. 文档说明
# renumber.vim
Installation
Using pathogen:
git clone https://github.com/clarke/vim-renumber.git ~/.vim/bundle/renumberDirectly:
# Make sure the vim plugin directory exists
mkdir -p ~/.vim/plugin
# Download the raw plugin
wget -O ~/.vim/plugin/renumber.vim https://raw.github.com/clarke/vim-renumber/master/plugin/renumber.vimNote: Substitute your vim plugin directory above if you have chosen to use a different location.
Summary
The purpose of this vim plugin is to allow easily reordering of numbered lists. This can be very useful when working with things like Markdown or other numbered lists. For example, say you have a list such as:
ToDo:
1. Take out the trash
2. Put dirty clothes in the wash
3. Go grocery shoppingIf you typically purchase trash bags and washing machine soap at the grocery store and realize that you are out of these things so you need to move grocery shopping to the top of the list, you would end up with this list:
3. Go grocery shopping
1. Take out the trash
2. Put dirty clothes in the washIn the past, I would record a macro using ctrl-a and/or ctrl-x to increment and decrement the numbers, but I found that somewhat tedious. This vim plugin allows you to highlight all rows in a list and run:
call Renumber()This will reorder the numbers in the list so that they are sequential starting from 1.
TODO
Better handling of sub-items
- Right now, only unordered sub-items will be ignored, but it should really ignore all sub-items including ordered sub-lists.
License
Copyright (c) Clarke Retzer. Distributed under the same terms as Vim itself. See :help license.