有一个Vim插件来预览markdown文件吗? [英] Is there a Vim plugin for previewing markdown files?
问题描述
我喜欢带有标记和Mou的编辑器,它们具有即时预览渲染结果的强大功能.所以我想知道,有没有办法在Vim中做同样的事情?
I love the marked and Mou editor which have the great capability to preview the rendering results on the fly. So I'm wondering, is there a way to do the same thing in Vim?
推荐答案
我最近发现了一个Chrome扩展程序,该扩展程序使Chrome能够正确打开并显示降价文件:
I recently found a Chrome extension that makes Chrome able to properly open and display markdown files: Markdown preview.
然后,只需要在Vim中映射键以使用Chrome打开文件即可.我的看起来像这样:
Then it was just a matter of mapping a key in Vim to open the file with Chrome. Mine looks like this:
" Open markdown files with Chrome.
autocmd BufEnter *.md exe 'noremap <F5> :!start C:\Users\tomas\AppData\Local\Google\Chrome\Application\chrome.exe %:p<CR>'
当然,如果您的文件不具有".md"扩展名,您希望将映射映射到其他键或Chrome位于其他位置,则必须对此命令进行编辑.
This command would have to be edited, of course, if your files don't have the ".md" extension, you want your mapping on a different key or if Chrome is located at a different location.
现在,每当我编辑".md"文件时,都可以点击<F5>
在Chrome中打开该文件.完美的解决方案是让Chrome每隔几秒钟自动重新加载,但我似乎找不到适合本地文件的扩展程序.
Now whenever I'm editing a ".md" file I can hit <F5>
to open the file in Chrome. A perfect solution would be to get Chrome to auto reload every few seconds, but I can't seem to find an such an extension that works for local files.
- 单击按钮即可预览减价文件,而无需任何正在运行的服务器或特殊代码.
- 可在支持Vim和Chrome的所有平台上使用-几乎涵盖了所有平台.
- 没有自动刷新,每次要预览文件时都必须按
<F5>
. - 没有Github风格的降价促销.
这篇关于有一个Vim插件来预览markdown文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!