在 ms-windows 上的 vim 中编辑时使用 firefox 预览 RestructedText

发布于 2024-08-02 17:01:39 字数 781 浏览 6 评论 0原文

我想使用 VIM 在多个操作系统中编辑重构的文本文档。

我发现这个帖子 http://www.zopyx.com/blog/editing- restructedtext-with-vim

你能帮我想出在 MS-Windows 操作系统上运行时达到相同效果的行吗?

是否也可以使用环境变量来指定临时文件的位置?

With an additional line in your .vimrc configuration file you can configure your own command that converts the buffer to HTML, saves the generates HTML on the filesystem and starts Firefox to preview the file:

.vimrc (LINUX):
:com RP :exec "Vst html" | w! /tmp/test.html | :q | !firefox /tmp/test.html

.vimrc (MacOSX):
:com RP :exec "Vst html" | w! /tmp/test.html | :q | !open /tmp/test.html

and you call the conversion pipeline from vim using new 'RP' command (RestPreview):

:RP

I want to use VIM to edit reStuctured text documents in a number of operating systems.

I found this posting http://www.zopyx.com/blog/editing-restructuredtext-with-vim

Can you help me come up with the line to achieve the same effect when run on a MS-Windows operating system?

Would it also be possible to to use an environment variable to specify the location of the temp file?

With an additional line in your .vimrc configuration file you can configure your own command that converts the buffer to HTML, saves the generates HTML on the filesystem and starts Firefox to preview the file:

.vimrc (LINUX):
:com RP :exec "Vst html" | w! /tmp/test.html | :q | !firefox /tmp/test.html

.vimrc (MacOSX):
:com RP :exec "Vst html" | w! /tmp/test.html | :q | !open /tmp/test.html

and you call the conversion pipeline from vim using new 'RP' command (RestPreview):

:RP

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千纸鹤 2024-08-09 17:01:39

我想这会很简单:

:com RP :exec "Vst html" | exe "w! " . $TMP . "/test.html" | :q | exe "silent !cmd /c start " . $TMP . "\\test.html"

话虽如此,我不确定为什么使用 :exec 来运行 Vst,这行不通?

:com RP Vst html | exe "w! " . $TMP . "/test.html" | :q | exe "silent !cmd /c start " . $TMP . "\\test.html"

不过我没有安装 Vst 插件,所以无法对此进行测试。

I would imagine this would be as simple as:

:com RP :exec "Vst html" | exe "w! " . $TMP . "/test.html" | :q | exe "silent !cmd /c start " . $TMP . "\\test.html"

Having said that, I'm not sure why :exec is used for running Vst, wouldn't this work?

:com RP Vst html | exe "w! " . $TMP . "/test.html" | :q | exe "silent !cmd /c start " . $TMP . "\\test.html"

I don't have the Vst plugin installed though, so I can't test this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文