Parse markdown to html and preview it, compatible with GitHub flavored markdown and support mermaid.
- Install
node.jsandnpm. - Install
markdown-itandhighlight.jspackages globallynpm install -g markdown-itnpm install -g highlight.js
- Set
NODE_PATHenvironment variable- add
export NODE_PATH=/usr/lib/node_modules:$NODE_PATHto~/.bash_profileor~/.zshrc - See http://stackoverflow.com/questions/13465829/node-js-modules-path for more infomation
- add
- Copy the
afterfolder to~/.vim. - Ensure you have the line
filetype plugin onin your.vimrc. - Open a markdown file in
vimand execute command:MkdView. Enjoy it!
-
:MkdView, to preview markdown file. The default key map<leader>vcalls this command. -
:Mkd2html, converting markdown file to html file and store html file.
g:mdv_theme, the theme of html file. The available values are :githubgithub2, the defaultgithub3clearclearDarkvuevue-dark
g:mdv_highlight_code, to highlight code or not, default value is1. If you want to prevent to highlight code, you can set it to0in.vimrc.g:mdv_code_theme, the theme of code in html file, provided by highlight.js. The default value isdefault. The possible values are :artaasceticatelier-dune.darkatelier-dune.lightatelier-forest.darkatelier-forest.lightatelier-heath.darkatelier-heath.lightatelier-lakeside.darkatelier-lakeside.lightatelier-seaside.darkatelier-seaside.lightcodepen-embedcolor-brewerdarkdefaultdoccofarfoundationgithubgooglecodehybridideair_blackkimbie.darkkimbie.lightmagulamono-bluemonokaimonokai_sublimeobsidianparaiso.darkparaiso.lightrailscastsrainbowsolarized_darksolarized_lightsunbursttomorrow-night-bluetomorrow-night-brighttomorrow-night-eightiestomorrow-nighttomorrowvsxcodezenburn
g:mdv_mermaid_img, Themermaidrenders graph assvg. If you want to render the graph as image, you can set this option to1. The default value is0.g:mdv_config_pack: a dictionary for pre-config for:MkdView config_nameand:Mkd2html config_namecommands
" this is a example
let g:mdv_config_pack = {
\ 'github': {
\ 'theme': 'github2',
\ 'highlight_code': 1,
\ 'code_theme': 'default',
\ 'mermaid_img': 0
\},
\ 'vue': {
\ 'theme': 'vue',
\ 'highlight_code': 1,
\ 'code_theme': 'default',
\ 'mermaid_img': 1
\}
\ }
- 2019-11-28
- MOD
:MkdView config_name - MOD
:Mkd2html config_name - ADD
:MarkdownView theme code_theme mermaid_img - ADD
:Markdown2html theme code_theme mermaid_img - ADD command complete for all commands
- MOD
- 2019-11-21
- Use
markdown-itinsteadofmarked
- Use
- 2016-08-30
- Remove
:MkdMailCommand
- Remove
- 2016-01-23
- bugfix
- 2016-01-21
- Add support for image and mermaid
- Remove
g:mdv_loaded,g:mdv_html
- 2015-11-09
- bug fix for heading, see markedjs/marked#642
- 2015-05-29
- add
:MkdMailcommand
- add
- 2015-01-15
- add highlight for code
