mirror of
https://github.com/amix/vimrc
synced 2025-07-10 03:25:00 +08:00
Updated plugins
This commit is contained in:
@ -1,12 +1,14 @@
|
||||
function! cargo#Load()
|
||||
function! cargo#Load()
|
||||
" Utility call to get this script loaded, for debugging
|
||||
endfunction
|
||||
|
||||
function! cargo#cmd(args)
|
||||
function! cargo#cmd(args) abort
|
||||
" Trim trailing spaces. This is necessary since :terminal command parses
|
||||
" trailing spaces as an empty argument.
|
||||
let args = substitute(a:args, '\s\+$', '', '')
|
||||
if has('terminal')
|
||||
if exists('g:cargo_shell_command_runner')
|
||||
let cmd = g:cargo_shell_command_runner
|
||||
elseif has('terminal')
|
||||
let cmd = 'terminal'
|
||||
elseif has('nvim')
|
||||
let cmd = 'noautocmd new | terminal'
|
||||
@ -98,6 +100,22 @@ function! cargo#bench(args)
|
||||
call cargo#cmd("bench " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#update(args)
|
||||
call cargo#cmd("update " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#search(args)
|
||||
call cargo#cmd("search " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#publish(args)
|
||||
call cargo#cmd("publish " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#install(args)
|
||||
call cargo#cmd("install " . a:args)
|
||||
endfunction
|
||||
|
||||
function! cargo#runtarget(args)
|
||||
let l:filename = expand('%:p')
|
||||
let l:read_manifest = system('cargo read-manifest')
|
||||
|
@ -499,7 +499,15 @@ function! s:SearchTestFunctionNameUnderCursor() abort
|
||||
|
||||
" Search the end of test function (closing brace) to ensure that the
|
||||
" cursor position is within function definition
|
||||
normal! %
|
||||
if maparg('<Plug>(MatchitNormalForward)') ==# ''
|
||||
keepjumps normal! %
|
||||
else
|
||||
" Prefer matchit.vim official plugin to native % since the plugin
|
||||
" provides better behavior than original % (#391)
|
||||
" To load the plugin, run:
|
||||
" :packadd matchit
|
||||
execute 'keepjumps' 'normal' "\<Plug>(MatchitNormalForward)"
|
||||
endif
|
||||
if line('.') < cursor_line
|
||||
return ''
|
||||
endif
|
||||
@ -541,21 +549,20 @@ function! rust#Test(mods, winsize, all, options) abort
|
||||
let saved = getpos('.')
|
||||
try
|
||||
let func_name = s:SearchTestFunctionNameUnderCursor()
|
||||
if func_name ==# ''
|
||||
echohl ErrorMsg
|
||||
echomsg 'No test function was found under the cursor. Please add ! to command if you want to run all tests'
|
||||
echohl None
|
||||
return
|
||||
endif
|
||||
if a:options ==# ''
|
||||
execute cmd . 'cargo test --manifest-path' manifest func_name
|
||||
else
|
||||
execute cmd . 'cargo test --manifest-path' manifest func_name a:options
|
||||
endif
|
||||
return
|
||||
finally
|
||||
call setpos('.', saved)
|
||||
endtry
|
||||
if func_name ==# ''
|
||||
echohl ErrorMsg
|
||||
echomsg 'No test function was found under the cursor. Please add ! to command if you want to run all tests'
|
||||
echohl None
|
||||
return
|
||||
endif
|
||||
if a:options ==# ''
|
||||
execute cmd . 'cargo test --manifest-path' manifest func_name
|
||||
else
|
||||
execute cmd . 'cargo test --manifest-path' manifest func_name a:options
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
@ -24,7 +24,7 @@ else
|
||||
if has('patch-7.4.191')
|
||||
CompilerSet makeprg=rustc\ \%:S
|
||||
else
|
||||
CompilerSet makeprg=rustc\ \%
|
||||
CompilerSet makeprg=rustc\ \"%\"
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -125,7 +125,7 @@ g:rustfmt_autosave~
|
||||
<
|
||||
There is also a buffer-local b:rustfmt_autosave that can be set for
|
||||
the same purpose, and can override the global setting.
|
||||
|
||||
|
||||
*g:rustfmt_autosave_if_config_present*
|
||||
g:rustfmt_autosave_if_config_present~
|
||||
Set this option to 1 to have *b:rustfmt_autosave* be set automatically
|
||||
@ -187,6 +187,16 @@ g:cargo_makeprg_params~
|
||||
let g:cargo_makeprg_params = 'build'
|
||||
<
|
||||
|
||||
*g:cargo_shell_command_runner*
|
||||
g:cargo_shell_command_runner~
|
||||
Set this option to change how to run shell commands for cargo commands
|
||||
|:Cargo|, |:Cbuild|, |:Crun|, ...
|
||||
By default, |:terminal| is used to run shell command in terminal window
|
||||
asynchronously. But if you prefer |:!| for running the commands, it can
|
||||
be specified: >
|
||||
let g:cargo_shell_command_runner = '!'
|
||||
<
|
||||
|
||||
|
||||
Integration with Syntastic *rust-syntastic*
|
||||
--------------------------
|
||||
|
@ -121,7 +121,7 @@ command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>)
|
||||
command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
|
||||
|
||||
" See |:RustFmt| for docs
|
||||
command! -buffer RustFmt call rustfmt#Format()
|
||||
command! -bar -buffer RustFmt call rustfmt#Format()
|
||||
|
||||
" See |:RustFmtRange| for docs
|
||||
command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>)
|
||||
|
1
sources_non_forked/rust.vim/triagebot.toml
Normal file
1
sources_non_forked/rust.vim/triagebot.toml
Normal file
@ -0,0 +1 @@
|
||||
[assign]
|
Reference in New Issue
Block a user