Ⅰ. 插件描述
Vim plugin for better use and managment of markdown listsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'leosxe/vim-markdownlists'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'leosxe/vim-markdownlists'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'leosxe/vim-markdownlists'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/leosxe/vim-markdownlists
Ⅳ. 文档说明
# Vim-markdownlists
Vim plugin for better use and managment of markdown lists
Features
This plugin is intended to use on markdown files that contains list, like this:
## Checkbox list
- [ ] ToDo1
- [ ] ToDo2
- [x] ToDo2.1
- [ ] ToDo2.2
- [x] ToDo3
## Unordered list
+ Item
+ Item
or
- Item
- Item
or
* Item
* Item
## Ordered list
1. Item1
2. Item2
3. Item3An unchecked checkbox looks like - [ ] while an checked one looks like - [x].
With this plugin, you can:
- Immediately create checkboxes and other list indicators (- [ ], +, -, *, 1.)
- Search for all the unchecked checkboxes and cycle through them with n and N
- Easily check/uncheck checkboxes (to do multiple ones, precede the binding with a number or select lines)
- Check the percentage of item done and the total number of checkboxes
All the functions in this plugin, by default, only work in markdown files. If you want to use them elsewhere, check the section below.
Keybindings
The complete table of the default keybindings
| Function | Keybinding | Mode | Variable | NotMarkdownOnly Variable |
|---|---|---|---|---|
| Keep creating list indicators (- [ ], +, -, *, 1.) if there is one on the current line | Enter | insert | g:markdownlists_enter | g:markdownlists_enter_notmarkdownonly |
| Create an empty checkbox | -\<TAB\> | insert | g:markdownlists_make_checkboxes | g:markdownlists_make_checkboxes_notmarkdownonly |
| Check/uncheck the checkbox on the current line | \<leader\>j | normal/visual | g:markdownlists_mark_checkboxes | g:markdownlists_mark_checkboxes_notmarkdownonly |
| Echo the percentage of items done in the current file | \<leader\>k | normal | g:markdownlists_count_checkboxes | g:markdownlists_count_checkboxes_notmarkdownonly |
| Search the next unchecked checkbox | \<leader\>a | normal/visual | g:markdownlists_search_undone | g:markdownlists_search_undone_notmarkdownonly |
Remapping
If you wish to remap a default keybinding, just add a line in your .vimrc like:
let variable = "mapping"where "variable" is the variable in the table before and "mapping" is your custom mapping.
Example:
let g:markdownlists_mark_checkboxes="<leader>cc"Not Markdown Only
By default, this plugin's remappings work only in Markdown files. To change this behaviour for determined functions, add a line in your .vimrc like:
let variable = 1where "variable" is the variable in the table, under the "Not Markdown Only" section.
Example:
let g:markdownlists_enter_notmarkdownonly=1Install
This plugin can be installed with whatever plugin manager you use:
Vundle
Plugin 'Leosxe/vim-markdownlists'
Pathogen
git clone https://github.com/leosxe/vim-markdownlists.git ~/.vim/bundle/vim-markdownlists
vim-plug
Plug 'https://github.com/leosxe/vim-markdownlists.git'
Default (vim version >= 8)
git clone https://github.com/leosxe/vim-markdownlists.git ~/.vim/pack/plugins/start/vim-markdownlists