Ⅰ. 插件描述
Live markdown preview for Vim on macOSⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'junegunn/vim-xmark'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'junegunn/vim-xmark'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'junegunn/vim-xmark'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/junegunn/vim-xmark
Ⅳ. 文档说明
vim-xmark
Markdown preview on OS X. Uses AppleScript to resize the windows.
Vim 8 is required for asynchronous rendering.
Screenshot
Xmark> on iTerm2

Xmark< on MacVim

Prerequisites
Xmark requires Homebrew and Google Chrome.
Installation
Using vim-plug:
Plug 'junegunn/vim-xmark', { 'do': 'make' }Usage
:Xmark command is added for Markdown files. After running the command, the
rendered content will be reloaded on the browser every time you save the file.
" Does not resize nor move the windows
:Xmark
" Vim on the left, browser on the right
:Xmark>
" On the left
:Xmark<
" On the top
:Xmark+
" On the bottom
:Xmark-
" Reload the page and resize the windows by saving it
:w
" Turn off Xmark
:Xmark!If you see an error (e.g. osascript is not allowed assistive access), make
sure that your terminal emulator (or MacVim) is in the list in `System
Preferences -> Security & Privacy -> Privacy -> Accessibility`. (You can
drag and drop the application icon to the list.)
Known issues
- Resizing does not work if the terminal emulator is in fullscreen mode
Acknowledgment
- GitHub style CSS is based on github-markdown-css by Sindre Sorhus licensed under MIT
- Previous version of CSS was based on: https://gist.github.com/killercup/5917178
License
MIT