Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
vim映射:带shell命令的w_Vim_Cygwin - Fatal编程技术网

vim映射:带shell命令的w

vim映射:带shell命令的w,vim,cygwin,Vim,Cygwin,第一张海报在这里 我目前正在使用cygwin和外部gvim。我把这个放在我的vimrc里了 autocmd FileType sass setlocal shiftwidth=2 tabstop=2 map <F5> <Esc>:w<CR>:!sass %<.sass %<.css<CR><CR> 我能摆脱“按任意键关闭此窗口…”吗。我只想不按任何键直接运行它。您可以使用:silent命令: map <F5>

第一张海报在这里

我目前正在使用cygwin和外部gvim。我把这个放在我的vimrc里了

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

我能摆脱“按任意键关闭此窗口…”吗。我只想不按任何键直接运行它。

您可以使用
:silent
命令:

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

太好了!谢谢。不管怎么说,制作be:w?我希望它像普通的:w一样工作,但当然要使用shell命令。
map <F5> <Esc>:w<CR>:silent !sass %<.sass %<.css<CR><CR> 
":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.