diff options
author | Nick Shipp <nick@shipp.ninja> | 2017-05-07 09:04:01 -0400 |
---|---|---|
committer | Nick Shipp <nick@shipp.ninja> | 2017-05-07 09:04:01 -0400 |
commit | c012f55efda29f09179e921cf148d79deb57616e (patch) | |
tree | ff0ad37f22622d51194cab192a2aa4b0106d7ad0 /vim/bundle/vim-racer/ftplugin | |
parent | 4ca8f6608883d230131f8a9e8b6d6c091c516049 (diff) |
Much maturering of vim configs
Diffstat (limited to 'vim/bundle/vim-racer/ftplugin')
-rw-r--r-- | vim/bundle/vim-racer/ftplugin/rust_racer.vim | 44 |
1 files changed, 44 insertions, 0 deletions
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('<sfile>: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 <silent><buffer> <Plug>(rust-def) + \ :call racer#GoToDefinition()<CR> +nnoremap <silent><buffer> <Plug>(rust-def-split) + \ :split<CR>:call racer#GoToDefinition()<CR> +nnoremap <silent><buffer> <Plug>(rust-def-vertical) + \ :vsplit<CR>:call racer#GoToDefinition()<CR> +nnoremap <silent><buffer> <Plug>(rust-doc) + \ :call racer#ShowDocumentation()<CR> + +setlocal omnifunc=racer#RacerComplete + +let &cpo = s:save_cpo +unlet s:save_cpo |