Parse markdown to html and preview it, compatible with GitHub flavored markdown and support mermaid.
- Install
node.js
andnpm
. - Install
markdown-it
andhighlight.js
packages globallynpm install -g markdown-it
npm install -g highlight.js
- Set
NODE_PATH
environment variable- add
export NODE_PATH=/usr/lib/node_modules:$NODE_PATH
to~/.bash_profile
or~/.zshrc
- See http://stackoverflow.com/questions/13465829/node-js-modules-path for more infomation
- add
- Copy the
after
folder to~/.vim
. - Ensure you have the line
filetype plugin on
in your.vimrc
. - Open a markdown file in
vim
and execute command:MkdView
. Enjoy it!
-
:MkdView
, to preview markdown file. The default key map<leader>v
calls 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 :github
github2
, the defaultgithub3
clear
clearDark
vue
vue-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 to0
in.vimrc
.g:mdv_code_theme
, the theme of code in html file, provided by highlight.js. The default value isdefault
. The possible values are :arta
ascetic
atelier-dune.dark
atelier-dune.light
atelier-forest.dark
atelier-forest.light
atelier-heath.dark
atelier-heath.light
atelier-lakeside.dark
atelier-lakeside.light
atelier-seaside.dark
atelier-seaside.light
codepen-embed
color-brewer
dark
default
docco
far
foundation
github
googlecode
hybrid
idea
ir_black
kimbie.dark
kimbie.light
magula
mono-blue
monokai
monokai_sublime
obsidian
paraiso.dark
paraiso.light
railscasts
rainbow
solarized_dark
solarized_light
sunburst
tomorrow-night-blue
tomorrow-night-bright
tomorrow-night-eighties
tomorrow-night
tomorrow
vs
xcode
zenburn
g:mdv_mermaid_img
, Themermaid
renders 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_name
and:Mkd2html config_name
commands
" 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-it
insteadofmarked
- Use
- 2016-08-30
- Remove
:MkdMail
Command
- 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
:MkdMail
command
- add
- 2015-01-15
- add highlight for code