You know that you can use “make” in your vim environment without any configuration but just go with command mode and just call “make”
But I’m very sure that you are wanna use your own build script instead of using bare “make”
Yes there is a tip for you certainly.
The option to assign a make program with your taste in vim is “makeprg”. Le me show you how it works.
Just leave this option in your .vimrc configuration file with your favorite build script like following
set makeprg=../build.sh
With only this configuration, you can use your favorite build script with fully customized in your taste.
And there is one more thing. The “quickfix” a feature of vim which helping you with jump into the warnings or errors which come after the build process. After the build process through your own script assigned with “set makeprg”, you might want to trace the warning you got after the build process and error as well.
The command for quickfix is “copen” and yes correctk it goes off with “cclose”.
I attached my own setting for vim bellow with bunch of shortkeys
더보기
set tags=./tags,/usr/src/linux/tags,/usr/include/tags
set number
set csprg=/usr/bin/cscope
set csto=0
set cst
set mouse=a
set nocsverb
set encoding=utf-8
"set sw=4
"set tabstop=8
"set expandtab
set autoindent
set cindent
set smartindent
set ruler
set wmnu
set lpl
set ic
set scs
set sc
set sm
set sel=exclusive
func! Man( )
let sm = expand("<cword>")
exe "!man -S 2:3:4:5:6:7:8:9:tcl:n:l:p:o ".sm
endfunc
nmap <F9> :call Man( )<cr><cr>
nmap <C-[>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-[>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-[>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-[>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-[>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-[>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-[>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-[>d :cs find d <C-R>=expand("<cword>")<CR><CR>
" Show trailing whitespace and spaces before tabs
hi link localWhitespaceError Error
au Syntax * syn match localWhitespaceError /\(\zs\%#\|\s\)\+$/ display
au Syntax * syn match localWhitespaceError / \+\ze\t/ display
# Main
# Argument description
# $1 : PWD from vim command mode
# $2 : argument comming after make like "cscope"
if [ "$2" == "cscope" ]; then
echo -e "cscope db build start\n"
cd $1
make cscope ARCH=arm
else
echo -e "kernel build start\n"
kernel $1
binaries $1
report $1
fi