win7系統中:用keil 對工程進行編譯連接,用gvim編輯查看源文件。html
一鍵跳轉到出現警告或者錯誤的源碼。shell
function! LoadErrLogFile() execute ":silent !bash.exe search_err.sh ./build/*log.htm" execute ":e err_log.c" endfunction function! LoadWarnLogFile() execute ":silent !bash.exe search_warning.sh ./build/*log.htm" execute ":e warning_log.c" endfunction
#!/bin/bash if [ -f "$1" ];then grep "): err" $1 > err_log.c fi
#!/bin/bash if [ -f "$1" ];then grep "): warning" $1 > warning_log.c fi
nnoremap <C-F11> :call LoadErrLogFile()<CR> nnoremap <C-F10> :call LoadWarnLogFile()<esc><CR> nnoremap <F10> :e warning_log.c<esc><CR> nnoremap <F11> :e err_log.c<esc><CR>
xx.c(linenum):error ...
原文出處:https://www.cnblogs.com/liujiangyi/p/10259806.htmlvim