Ⅰ. 插件描述
Markdown formatting plugin for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'moorereason/vim-markdownfmt'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'moorereason/vim-markdownfmt'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'moorereason/vim-markdownfmt'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/moorereason/vim-markdownfmt
Ⅳ. 文档说明
vim-markdownfmt
Markdown formatting plugin for Vim. Designed to work with "gofmt-style" commands such as markdownfmt and mdfmt.
Installation
Vundle
If you use Vundle, add the following to your vimrc:
Plugin 'moorereason/vim-markdownfmt'Then install with:
:PluginInstallPathogen
If you use Pathogen, do this:
cd ~/.vim/bundle
git clone https://github.com/moorereason/vim-markdownfmt.gitOptions
Command Executable
Define which "fmt" executable you want to use. It must be in your PATH. Default is markdownfmt.
let g:markdownfmt_command = 'markdownfmt'Command Options
Define options to be passed to command executable. Default is empty. Note that -w is always passed as an option.
let g:markdownfmt_options = ''Autosave
Set whether to automatically run format command on save. Default is 0.
let g:markdownfmt_autosave=0Fail Silently
Set whether to fail silently (1) or show errors (0). Default is 0 (show errors).
let g:markdownfmt_fail_silently=0Key Bindings
If you decide to leave the autosave feature disabled, you can use a command like the following to format and save the current buffer.
au FileType markdown nmap <leader>s :<C-u>call markdownfmt#Format()<CR>Credits
- The Go Authors for their
gofmtVim plugin. - vim-go Contributors for inspiration.
- Contributors of vim-markdownfmt.
License
MIT License. See file LICENSE for more details.