From a586c7906fb3ee117fcb9f8ccf4176bc760402c3 Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Tue, 21 Mar 2017 09:55:05 -0400 Subject: [PATCH] Tweaks to vim rust setup --- vimrc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/vimrc b/vimrc index 03bb996..a995193 100644 --- a/vimrc +++ b/vimrc @@ -182,9 +182,10 @@ map sn :sp ~/.personal-files/documents/software-notes/clojure.md map rn :sp ~/.work-files/dive-networks/files/notes/refactoring-notes.md """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Run build script +" Build commands """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -function! RunBuildScript() + +function! RunBuildCommand(command) let l:existing_buf = bufwinnr("__build_output_log__") let l:current_buf = bufnr("%") @@ -204,14 +205,16 @@ function! RunBuildScript() normal! ggdG " Output compile log into buffer - let l:output = system("./build.sh") + let l:output = system(a:command) call append(0, split(l:output, '\v\n')) go silent! exe l:existing_buf. " wincmd w" endfunction -nnoremap b :call RunBuildScript() +nnoremap b :call RunBuildCommand("./build.sh") +nnoremap cb :call RunBuildCommand("cargo build") +nnoremap cr :call RunBuildCommand("cargo run") nnoremap bb :bw! """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -561,7 +564,7 @@ let g:clojure_fuzzy_indent_blacklist = ['-fn$', '\v^with-%(meta|out-str|loading- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " RUST.VIM """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -let g:rustfmt_autosave = 1 " auto run rust formatter when saving +"let g:rustfmt_autosave = 1 " auto run rust formatter when saving """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " FILESEARCH @@ -588,9 +591,9 @@ let g:syntastic_check_on_wq = 0 " Customize Rust " https://github.com/rust-lang/rust.vim/issues/130 " Can remove once this Syntastic PR is merged https://github.com/rust-lang/rust.vim/pull/132 -let g:syntastic_rust_rustc_exe = 'cargo check' -let g:syntastic_rust_rustc_fname = '' -let g:syntastic_rust_checkers = ['rustc'] +"let g:syntastic_rust_rustc_exe = 'cargo check' +"let g:syntastic_rust_rustc_fname = '' +"let g:syntastic_rust_checkers = ['rustc'] """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""