Pregunta

Quiero usar VIM para editar documentos de texto reStuctured en varios sistemas operativos.

He encontrado este anuncio http://www.zopyx.com/blog / editar-reStructuredText-con-vim

¿Me pueden ayudar llegado con la línea para lograr el mismo efecto cuando se ejecuta en un sistema operativo MS Windows?

¿También sería posible utilizar una variable de entorno para especificar la ubicación del archivo temporal?

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
¿Fue útil?

Solución

Me imagino que esto podría ser tan simple como:

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

Una vez dicho esto, yo no estoy seguro de por qué no :exec se utiliza para ejecutar VST, volvería a este trabajo?

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

No tengo el plugin VST instalado sin embargo, así que no puedo probar esto.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top