Markdown formatting plugin for Vim. Designed to work with "gofmt-style" commands such as markdownfmt and mdfmt.
If you use Vundle, add the following to your vimrc
:
Plugin 'moorereason/vim-markdownfmt'
Then install with:
:PluginInstall
If you use Pathogen, do this:
cd ~/.vim/bundle
git clone https://github.com/moorereason/vim-markdownfmt.git
Define which "fmt" executable you want to use. It must be in your PATH. Default is markdownfmt
.
let g:markdownfmt_command = 'markdownfmt'
Define options to be passed to command executable. Default is empty. Note that -w
is always passed as an option.
let g:markdownfmt_options = ''
Set whether to automatically run format command on save. Default is 0
.
let g:markdownfmt_autosave=0
Set whether to fail silently (1) or show errors (0). Default is 0 (show errors).
let g:markdownfmt_fail_silently=0
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>
- The Go Authors for their
gofmt
Vim plugin. - vim-go Contributors for inspiration.
- Contributors of vim-markdownfmt.
MIT License. See file LICENSE
for more details.