ms-windows의 vim에서 편집하는 동안 Firefox를 사용하여 RestructuredText 미리보기

StackOverflow https://stackoverflow.com/questions/1310989

문제

VIM을 사용하여 여러 운영 체제에서 재구성된 텍스트 문서를 편집하고 싶습니다.

이 포스팅을 발견했어요 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
도움이 되었습니까?

해결책

나는 이것이 다음과 같이 간단하다고 생각합니다.

: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 플러그인이 설치되어 있지 않아서 테스트할 수 없습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top