From fd023a78dc2a1041afd675f548d30e3c5ef38c4e Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Fri, 9 Jun 2017 19:16:15 -0400 Subject: [PATCH] Support custom run scripts in Vim --- vimrc | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/vimrc b/vimrc index 9e82685..1c8f17b 100644 --- a/vimrc +++ b/vimrc @@ -236,12 +236,6 @@ map rn :sp ~/.work-files/dive-networks/files/notes/refactoring-notes.md< """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Build Commands """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -function! RunBuildCommand(command) - silent! wall " Save current buffer in case there are unsaved changes - execute 'AsyncRun' a:command -endfunction - " AsyncRun status line let g:airline_section_error = airline#section#create_right(['%{g:asyncrun_status}']) @@ -264,9 +258,16 @@ set errorformat+=\\\ %#%f(%l)\ :\ %#%t%[A-z]%#\ %m " Microsoft HLSL compiler: fxc.exe set errorformat+=\\\ %#%f(%l\\\,%c-%*[0-9]):\ %#%t%[A-z]%#\ %m -" Run custom build script with b or F8 +" Execute build script + +function! RunBuildCommand(command) + execute 'AsyncRun! -save=2' a:command +endfunction + nnoremap b :call RunBuildCommand("./build.sh") nnoremap :call RunBuildCommand("./build.sh") +" Execute run script +nnoremap br :AsyncRun! ./run.sh "Go to next build error nnoremap :cn @@ -276,10 +277,6 @@ nnoremap :cn nnoremap :cp nnoremap :cp -" Rust build commands -nnoremap bc :call RunBuildCommand("cargo build") -nnoremap br :call RunBuildCommand("cargo run") - """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Lisp """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""