Real-time markdown preview plugin for vim.
Latest Vim which has +channel
and +job
features.
Python 3.5+ and wdom, misaka, and pygments are also required to be installed in your python.
To install them:
pip3 install -U wdom misaka pygments
Or,
python3 -m pip intsall -U wdom misaka pygments
When clone into your pack/start
, need --recurcive
option since this plugin includes git-submodule.
git clone --recurcive https://github.com/miyakogi/vim-livemark2
Open markdown file and execute :LiveMark
.
This command opens browser window and starts real-time preview.
To stop previewing, execute :LiveMarkDisable
command.
By adding theme-name as an argument of the :LiveMark
command, livemark change theme of the preview window.
To see available themes, press <Tab>
key after :LiveMark
on vim.
Default theme is skyblue
.
Note: Former version supported use-define js/css files, but current version does not support this feature.
LiveMark.vim has BrowserMode.
When execute :LiveMarkBrowserMode
, some keys (j/k/<C-d>/<C-u>/<C-f>/<C-b>/gg/G
) become to move browser window, not vim.
To exit this mode, press <Esc>
key or execute :LiveMarkBrowserModeExit
.
TODO: prepare screen cast.
Note: Former version has cursor sync feature, but its removed now.
This plugin uses python3 installed in your path by default. If you want to use another python, you can specify the path as follows:
let g:livemark_python = '/path/to/python/binary' " default 'python3'
By default, this plugin use system's default browser to show preview.
To use other browser, for example, firefox, set g:livemark_browser
variable in your vimrc.
let g:livemark_browser = 'firefox'
This value is passed to python's webbrowser module. Available browsers and corresponding names are listed here.
For now, this plugin uses two ports; one for tornado web-server (8089), and the other for sending markdown texts from vim (8090). If you want to change these port numbers, add the following lines to your vimrc and change values as you like.
let g:livemark_browser_port = 8089
let g:livemark_vim_port = 8090
Default theme can change via g:livemark_theme
option.
The following setting change default theme to bootstrap3
.
let g:livemark_theme = "bootstrap3"
This setting can be overridden by :LiveMark
command's argument.
LiveMark.vim supports code blocks and syntax highlighting. If you change theme of the code block, add the below option.
let g:livemark_highlight_theme = 'friendly' " default ''
To list all available themes, run below command in shell.
python3 -c "import pygments.styles; print(pygments.styles.STYLE_MAP.keys())"