2009-08-21 4 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의 실행에 사용되는 이유는,이 작품 확실하지 않은 것 아니에요, 그런 말로 미루어?

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

Vst 플러그인이 설치되어 있지 않으므로 테스트 할 수 없습니다.

+0

두 번째 줄은 작동하지만 두 번째 줄은 작동하지 않습니다. 당신의 도움을 주셔서 감사합니다. –

+0

@Rudiger :이 경우 Vst는'-bar' 옵션으로 정의되지 않았기 때문에 다른 명령이 올 수 있습니다. 그것은': exe'를 사용할 필요성을 설명합니다. – DrAl

관련 문제