Ⅰ. 插件描述
Yet, just another markdown preview plugin for vim.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mikecoder/markdown-preview-vim-love-story'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mikecoder/markdown-preview-vim-love-story'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mikecoder/markdown-preview-vim-love-story'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mikecoder/markdown-preview.vim
Ⅳ. 文档说明
markdown-preview.vim
Yet another vim markdown preview plugin. Not suitable for Windows.
Why you need this
- CommonMark Syntax Support
- It's easy to install with vundle or bundle
- No complex config steps
- Code Hightlight
- Easy to custom your own css style
- Code custom style hightlight(using hightlight.js)
- Now support flowcharts feature! (based on mermaid, should read the doc first)
Dependency
You may install some libraries first:
(sudo) pip install future
(sudo) pip install mistuneInstalling
Recommend Bundle or Vundle
Vundle
- you can see how to install vundle here
- after you install your vundle, make sure your plugins folder is ~/.vim/bundle
- then you can write this plugin url into your .vimrc file, like Plugin 'MikeCoder/markdown-preview.vim'
- then use PluginInstall to install the plugin
Install without Vundle or other pacakage management plugins
- this is not a good choice, make sure every step is right
- use cd ~/.vim into your vim folder
- use git clone https://github.com/MikeCoder/markdown-preview.vim.git .
- use mv markdown-preview.vim/* . && rm -rf markdown-preview.vim
- use cp -r resources MarkDownRes to copy the resources
- then you can open your vim and type :MarkdownPreview Github to check whether it is ok
Usage
You can see example document here TEST.md
Config
If your plugin folder is not .vim/bundle, you should config it first, by adding these into your .vimrc file:
Like:
" markdown-preview.vim {{{
let g:PluginDir = '/Users/Mike/.vim/bundle/markdown-preview.vim'
" }}}- g:PluginDir is where your markdown-preview.vim plugin is.
Common Usage
- edit your markdown doc normally
- when you want to preview it in html you just use :MarkdownPreview default to show your doc in your browser
- if you want to change your style. you just use :MarkdownPreview GitHub in github style markdown view
- you can also use the following code to your vimrc file to bind key maps.
map <leader>m :MarkdownPreview GitHub<CR>Advanced Usage
Preview with custom code sytle and body style
- use :MarkdownPreviewWithCustomCodeStyle css-style code-style instead
- you can use custom css style and code hightlight style
the following are code styles you can use:
- github
- solarized_dark
- solarized_light
- default
- color-brewer
- railscasts
- tomorrow
- zenburn
- mono
- monokai_sublime
- these code css files are in your ~/.vim/MarkDownRes/code-styles folder
- for example, when you use :MarkdownPreviewWithCustomCodeStyle GitHub zenburn, when edit the TEST.md
For flowcharts
I don't recommand you to use this feature due to many websites or editors not supporting this feature which may confuse you.
However, if you want to use the flowcharts feature, you must add the type when you writing flowcharts, for example, when you write,
you should add chart to the code block as below:
Then when you use MarkdownPreview github, you can see the result as below:
Customize
This theme is in the css folder, if you want to change it to your favorite theme. follow the steps:
- go into your markdown-preview.vim folder
- find resources folder and you will find default.css and github.css here
- add your custom css file here, such as example.css
- use vim open your markdown doc and :MarkdownPreview example
- and you will see your doc preview in your browser with example.css
Thanks
TODO
See @TODO.md
LAST
Wish you have a nice day
LICENSE
See @LICENSE



