The
write-mode is already set to "overwrite". If not specified it
defaults to '' : >vim
let g:rustfmt_options = ''
<
*g:rustfmt_emit_files*
g:rustfmt_emit_files ~
If not specified rust.vim tries to detect the right parameter to
pass to rustfmt based on its reported version. Otherwise, it
determines whether to run rustfmt with '--emit=files' (when 1 is
provided) instead of '--write-mode=overwrite'. >vim
let g:rustfmt_emit_files = 0
<
*g:rust_playpen_url*
g:rust_playpen_url ~
Set this option to override the url for the playpen to use: >vim
let g:rust_playpen_url = 'https://play.rust-lang.org/'
<
*g:rust_shortener_url*
g:rust_shortener_url ~
Set this option to override the url for the url shortener: >vim
let g:rust_shortener_url = 'https://is.gd/'
<
*g:rust_clip_command*
g:rust_clip_command ~
Set this option to the command used in your OS to copy the Rust Play
url to the clipboard: >vim
let g:rust_clip_command = 'xclip -selection clipboard'
<
*g:cargo_makeprg_params*
g:cargo_makeprg_params ~
Set this option to the string of parameters to pass to cargo. If not
specified it defaults to `$*` : >vim
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: >vim
let g:cargo_shell_command_runner = '!'
<
------------------------------------------------------------------------------
Integration with Syntastic *rust-syntastic*
This plugin automatically integrates with the Syntastic checker. There are two
checkers provided: `rustc`, and `cargo`. The latter invokes `cargo` in order to
build code, and the former delivers a single edited '.rs' file as a compilation
target directly to the Rust compiler, `rustc`.
Because Cargo is almost exclusively being used for building Rust code these
days, `cargo` is the default checker. >vim
let g:syntastic_rust_checkers = ['cargo']
<
If you would like to change it, you can set `g:syntastic_rust_checkers` to a
different value.
*g:rust_cargo_avoid_whole_workspace*
*b:rust_cargo_avoid_whole_workspace*
g:rust_cargo_avoid_whole_workspace ~
When editing a crate that is part of a Cargo workspace, and this
option is set to 1 (the default), then `cargo` will be executed
directly in that crate directory instead of in the workspace
directory. Setting 0 prevents this behavior - however be aware that if
you are working in large workspace, Cargo commands may take more time,
plus the Syntastic error list may include all the crates in the
workspace. >vim
let g:rust_cargo_avoid_whole_workspace = 0
<
*g:rust_cargo_check_all_targets*
*b:rust_cargo_check_all_targets*
g:rust_cargo_check_all_targets ~
When set to 1, the `--all-targets` option will be passed to cargo when
Syntastic executes it, allowing the linting of all targets under the
package.
The default is 0.
*g:rust_cargo_check_all_features*
*b:rust_cargo_check_all_features*
g:rust_cargo_check_all_features ~
When set to 1, the `--all-features` option will be passed to cargo when
Syntastic executes it, allowing the linting of all features of the
package.
The default is 0.
*g:rust_cargo_check_examples*