2009-08-21 5 views
3

多くのオペレーティングシステムで再構成されたテキストドキュメントを編集するためにVIMを使用したいと思います。ms-windows上でvimで編集中にFirefoxを使ってRestructuredTextをプレビューする

私は、これはhttp://www.zopyx.com/blog/editing-restructuredtext-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 

答えて

2

私は、これはのような単純なものだろうと想像します:

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

:execがVstとを実行するために使用されている理由私は、この作品わからないとないんだけど、と言いましたか?

私はVstプラグインをインストールしていないので、これをテストすることはできません。

+0

第1の行は機能し、第2の行は機能しません。ご協力いただきありがとうございます。 –

+0

@Rudiger:この場合、Vstは '-bar'オプションで定義されていないと思います。これは、他のコマンドが続くことを許します。それは ':exe'を使う必要性を説明するでしょう。 – DrAl