1、把下列代码加入你的.vimrc文件(~.vimrc) "this script use to excute make in vim and open quickfix window nmap B :call Do_make() nmap C :cclose function Do_make() let filename = bufname("%") let suffix_pos = stridx(filename, ".c") if suffix_pos == -1 return else let target = strpart(filename,0,suffix_pos) endif let target = "make " . target