2010-01-28 178 views
1

SO的第一張海報。vim映射:w帶shell命令

我目前使用cygwin與外部gvim。我在的vimrc得到這個

autocmd FileType sass setlocal shiftwidth=2 tabstop=2 
map <F5> <Esc>:w<CR>:!sass %<.sass %<.css<CR><CR> 

我想要的工作就像一個正常的:W同時運行薩斯,我該怎麼做呢?

而且也是,在我的vimrc運行這個時候,我總是bash.exe飛出接着說

c:\cygwin\bin\bash.exe -c "sass style.sass style.css" 
Hit any key to close this window... 

我能否擺脫「按任意鍵可關閉此窗口......」。我只是想直接運行它,而不需要按任何鍵。

回答

3

您可以做到這一點使用:silent命令:

map <F5> <Esc>:w<CR>:silent !sass %<.sass %<.css<CR><CR> 

:silent幫助說:

 
    ":silent" will also avoid the hit-enter prompt. When 
    using this for an external command, this may cause the 
    screen to be messed up. Use |CTRL-L| to clean it up 
    then. 
+0

WAW太棒了!非常感謝。 總之製作是:w? 我希望它像一個正常的工作:W,但當然與該shell命令。 – 2010-01-28 23:42:25