Question

Je veux utiliser VIM pour modifier des documents texte reStuctured dans un certain nombre de systèmes d'exploitation.

J'ai trouvé cette annonce http://www.zopyx.com/blog / édition-reStructuredText-avec-vim

Pouvez-vous me aider à trouver la ligne pour obtenir le même effet lorsqu'il est exécuté sur un système d'exploitation MS Windows?

Serait-il également possible d'utiliser une variable d'environnement pour spécifier l'emplacement du fichier temp?

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
Était-ce utile?

La solution

J'imagine que ce serait aussi simple que:

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

Cela dit, je ne sais pas pourquoi :exec est utilisé pour exécuter Vst, ne serait-ce travail?

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

Je n'ai pas le plug-in Vst installé, donc je ne peux pas tester.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top