diff options
author | Jesse Luehrs <doy@tozt.net> | 2023-10-08 12:09:20 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2023-10-08 12:59:10 -0400 |
commit | 49570c8dd03448240897b37b68567352b790f16f (patch) | |
tree | 6c192a52046d5d0dd1b84a838befd8e777cfeafb /vim/.vim/ftplugin/rust.vim | |
parent | 66939c71da756c1d9e07a88a4a8ea2a018650060 (diff) | |
download | conf-49570c8dd03448240897b37b68567352b790f16f.tar.gz conf-49570c8dd03448240897b37b68567352b790f16f.zip |
convert to stow
Diffstat (limited to 'vim/.vim/ftplugin/rust.vim')
-rw-r--r-- | vim/.vim/ftplugin/rust.vim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vim/.vim/ftplugin/rust.vim b/vim/.vim/ftplugin/rust.vim new file mode 100644 index 0000000..2b9606e --- /dev/null +++ b/vim/.vim/ftplugin/rust.vim @@ -0,0 +1,18 @@ +let b:ale_linters = { 'rust': ['analyzer'] } +let b:ale_rust_analyzer_config = { + \'checkOnSave': { 'command': 'clippy' }, + \'cargo': { 'allFeatures': v:true }, + \'diagnostics': { 'disabled': ['inactive-code'] }, +\} +let b:ale_fixers = { 'rust': ['rustfmt'] } +let b:ale_fix_on_save = 1 +let b:ale_rust_rustfmt_options = "--edition 2018" + +map <buffer> <CR> :ALEGoToDefinition<CR> + +if filereadable("Cargo.toml") + compiler cargo + setlocal makeprg=cargo\ build +else + setlocal makeprg=rustc\ % +endif |