From c012f55efda29f09179e921cf148d79deb57616e Mon Sep 17 00:00:00 2001 From: Nick Shipp Date: Sun, 7 May 2017 09:04:01 -0400 Subject: Much maturering of vim configs --- vim/bundle/vim-racer/ftplugin/rust_racer.vim | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 vim/bundle/vim-racer/ftplugin/rust_racer.vim (limited to 'vim/bundle/vim-racer/ftplugin') diff --git a/vim/bundle/vim-racer/ftplugin/rust_racer.vim b/vim/bundle/vim-racer/ftplugin/rust_racer.vim new file mode 100644 index 0000000..a76fc3b --- /dev/null +++ b/vim/bundle/vim-racer/ftplugin/rust_racer.vim @@ -0,0 +1,44 @@ +let s:save_cpo = &cpo +set cpo&vim + +let s:is_win = has('win32') || has('win64') + +if !exists('g:racer_cmd') + let s:sep = s:is_win ? '\' : '/' + let s:path = join([ + \ escape(expand(':p:h'), '\'), + \ '..', + \ 'target', + \ 'release', + \ ], s:sep) + if isdirectory(s:path) + let s:pathsep = s:is_win ? ';' : ':' + let $PATH .= s:pathsep . s:path + endif + let g:racer_cmd = 'racer' +endif + +" Expand '~' and environment variables +let g:racer_cmd = expand(g:racer_cmd) + +if !exists('g:racer_experimental_completer') + let g:racer_experimental_completer = 0 +endif + +if !exists('g:racer_insert_paren') + let g:racer_insert_paren = 1 +endif + +nnoremap (rust-def) + \ :call racer#GoToDefinition() +nnoremap (rust-def-split) + \ :split:call racer#GoToDefinition() +nnoremap (rust-def-vertical) + \ :vsplit:call racer#GoToDefinition() +nnoremap (rust-doc) + \ :call racer#ShowDocumentation() + +setlocal omnifunc=racer#RacerComplete + +let &cpo = s:save_cpo +unlet s:save_cpo -- cgit v1.2.3-70-g09d2