@@ -6,12 +6,12 @@ Use the markdown-preview.vim plugin you can preview markdown on real-time
66through a browser
77
88> this plugin need your vim support py2/py3 features
9- > test on windows/ubuntu14
9+ > test on windows/ubuntu14/Mac OS X
1010
1111
1212### screenshot
1313
14- ![ screenshot] ( ./screenshot .gif)
14+ ![ screenshot] ( https://cloud.githubusercontent.com/assets/5492542/15363504/839753be-1d4b-11e6-9ac8-def4d7122e8d .gif)
1515
1616### Installation
1717
@@ -57,6 +57,26 @@ MarkdownPreviewStop command before using MarkdownPreview command
5757 " set to 1, the vim will just refresh markdown when save the buffer or
5858 " leave from insert mode, default 0 is auto refresh markdown as you edit or
5959 " move the cursor
60+
61+ let g:mkdp_command_for_global = 0
62+ " set to 1, the MarkdownPreview command can be use for all files,
63+ " by default it just can be use in markdown file
64+ ```
65+
66+ ** Key Mapping:**
67+
68+ By default this Plugin has no mapping, if you want to has your own mapping
69+ you can map the keys to ` <Plug>MarkdownPreview ` for opening markdown preview window and
70+ map keys to ` <Plug>StopMarkdownPreview ` for closing the preview window
71+
72+ Examples for mapping the ` F8 ` key to open markdown preview window and ` F9 ` key to
73+ close preview window:
74+
75+ ```
76+ nmap <silent> <F8> <Plug>MarkdownPreview " for normal mode
77+ imap <silent> <F8> <Plug>MarkdownPreview " for insert mode
78+ nmap <silent> <F9> <Plug>StopMarkdownPreview " for normal mode
79+ imap <silent> <F9> <Plug>StopMarkdownPreview " for insert mode
6080```
6181
6282For ** OS X** users you can set the ` g:mkdp_path_to_chrome ` as below (if you use chrome):
@@ -70,6 +90,7 @@ see issue[#1](https://github.com/iamcco/markdown-preview.vim/issues/1) for detai
7090
7191### Changelog
7292
93+ * 2016/05/18: support key mapping and new ` g:mkdp_command_for_global ` option item
7394* 2016/03/12: new Github like markdown styles [ markdown.css] ( https://github.com/iamcco/markdown.css ) and support task list
7495* 2016/01/24: support display the local picture in markdown
7596
@@ -123,6 +144,25 @@ see issue[#1](https://github.com/iamcco/markdown-preview.vim/issues/1) for detai
123144 let g:mkdp_refresh_slow = 0
124145 " 设置为 1 则只有在保存文件,或退出插入模式的时候更新预览,默认为 0,实时
125146 " 更新预览
147+
148+ let g:mkdp_command_for_global = 0
149+ " 设置为 1 则所有文件都可以使用 MarkdownPreview 进行预览,默认只有 markdown
150+ " 文件可以使用改命令
151+ ```
152+
153+ ** 键位绑定:**
154+
155+ 默认情况下,插件没有进行任何的按键绑定,如果想绑定按键去预览 markdown 文件,可以绑定
156+ 按键到` <Plug>MarkdownPreview ` 来打开预览窗口,绑定按键到` <Plug>StopMarkdownPreview ` 来
157+ 关闭预览窗口。
158+
159+ 按键绑定例子(` F8 ` 打开预览窗口,` F9 ` 关闭预览窗口):
160+
161+ ```
162+ nmap <silent> <F8> <Plug>MarkdownPreview " 普通模式
163+ imap <silent> <F8> <Plug>MarkdownPreview " 插入模式
164+ nmap <silent> <F9> <Plug>StopMarkdownPreview " 普通模式
165+ imap <silent> <F9> <Plug>StopMarkdownPreview " 插入模式
126166```
127167
128168** 苹果** 用户如果使用chrome可以参照以下设置 ` g:mkdp_path_to_chrome ` :
@@ -136,6 +176,7 @@ let g:mkdp_path_to_chrome = "/Applications/Google\\ Chrome.app/Contents/MacOS/Go
136176
137177### Changelog
138178
179+ * 2016/05/18: 支持按键绑定,并增加新的 ` g:mkdp_command_for_global ` 配置项
139180* 2016/03/12: 使用新的 Github 样式 [ markdown.css] ( https://github.com/iamcco/markdown.css ) ,并且支持显示 todo 任务列表
140181* 2016/01/24: 支持显示本地图片
141182
0 commit comments