diff --git a/autoload/cargo.vim b/autoload/cargo.vim index a95a57f9..007d338d 100644 --- a/autoload/cargo.vim +++ b/autoload/cargo.vim @@ -116,6 +116,10 @@ function! cargo#install(args) call cargo#cmd("install " . a:args) endfunction +function! cargo#clippy(args) + call cargo#cmd("clippy " . a:args) +endfunction + function! cargo#runtarget(args) let l:filename = expand('%:p') let l:read_manifest = system('cargo read-manifest') diff --git a/doc/rust.txt b/doc/rust.txt index 9d5eb8cc..a0ac2953 100644 --- a/doc/rust.txt +++ b/doc/rust.txt @@ -323,6 +323,9 @@ This plug defines very simple shortcuts for invoking Cargo from with Vim. :Cinstall *:Cinstall* Shortcut for 'cargo install`. +:Cclippy *:Cclippy* + Shortcut for 'cargo clippy`. + :Cruntarget *:Cruntarget* Shortcut for 'cargo run --bin' or 'cargo run --example', depending on the currently open buffer. diff --git a/plugin/cargo.vim b/plugin/cargo.vim index efc38768..ce65eb5c 100644 --- a/plugin/cargo.vim +++ b/plugin/cargo.vim @@ -19,6 +19,7 @@ command! -nargs=* Cupdate call cargo#update() command! -nargs=* Csearch call cargo#search() command! -nargs=* Cpublish call cargo#publish() command! -nargs=* Cinstall call cargo#install() +command! -nargs=* Cclippy call cargo#clippy() command! -nargs=* Cruntarget call cargo#runtarget() let &cpoptions = s:save_cpo