A simplified and flexible markdown preview for vim user on Mac. Using applescript instead of a server to enhance the exprience of live preview.
You can get the style preview here
- No server, much better performance.
- Async markdown parse when possible (using jobstart of nvim/vim or vimproc)
- Works out of box, all dependencies are optional.
- Preview in Chrome with range and auto reload support.
- Auto close Chrome tab on buffer delete and vim exit.
- Tables, GFM enabled, code highlight and footnote enabled by default.
- Misaka parser support smartypants, toc (table of content) and unicode (including Emoji)
Take vundle as example:
To preview current markdown file, type:
Preview with range, eg:
Or visual select a range, and use:
To toggle auto preview for current file, type:
The corresponding chrome tab would be activated and refreshed on TextChanged and TextChangedI. A handy remap could be:
nnoremap <C-p> :PreviewAuto<CR>
macdown.vim using markit for
markdown parsing, it's exists inside this repository, but if you need speed and
more future, you can set global variable:
let g:macdown_marked_programme = 'misaka'
To enable misaka parse, it's almost 4 times faster than markit, but you need to install python dependencies:
pip install misaka pygments
sudo might be required.
You can also make your own parser, just create a excutable file that
accepts markdown content from stdin and output html to stdout, then
g:macdown_external_programme to the path of the file:
let g:macdown_external_programme = '~/my-parser'
- Scrollbind for vim and Chrome (vim doesn't support Scroll autocmd, bind CurseMove would be rediculious for me)