diff --git a/vimrc b/vimrc index 0cd7e30..516dcb0 100644 --- a/vimrc +++ b/vimrc @@ -121,6 +121,8 @@ let g:campo_custom_search_args = "" " CTAGS """""""""""""" +" I use the ctags executable from https://github.com/universal-ctags/ctags-win32/releases + " If != 0 then ctag generation will always happen on a file save, otherwise " it'll only be triggered if the file being saved has an extension in the " g:campo_extensions_that_run_ctags list. @@ -1064,7 +1066,7 @@ augroup END hi def link MyNotes Notes augroup vimrc_notices - au! + autocmd! autocmd Syntax * syn match MyNotices /\v<(WARNING|IMPORTANT):/ \ containedin=.*Comment,vimCommentTitle augroup END @@ -1138,9 +1140,23 @@ function! ExecuteRunScript() exec "AsyncRun! -post=call\\ StopRunTask() ./run %" endfunction +function! Build() + let l:extension = tolower(expand('%:e')) + if l:extension == "jai" + exec "AsyncRun! -save=2 jai %" + else + exec "AsyncRun! -save=2 ./build* %" + endif +endfunction + function! SilentBuild() AsyncStop - exec "AsyncRun! -save=2 -post=call\\ HideAsyncResults() ./build* %" + let l:extension = tolower(expand('%:e')) + if l:extension == "jai" + exec "AsyncRun! -save=2 -post=call\\ HideAsyncResults() jai %" + else + exec "AsyncRun! -save=2 -post=call\\ HideAsyncResults() ./build* %" + endif endfunction " Show results window the moment the async job starts @@ -1157,7 +1173,7 @@ nnoremap bc :call ToggleBuildResults() noremap :call HideBuildResultsAndClearErrors() " Execute build script -nnoremap b :AsyncRun! -save=2 ./build* % +nnoremap b :call Build() nnoremap :call SilentBuild() " Execute run script