summaryrefslogtreecommitdiffstats
path: root/vim/ftplugin/rust.vim
blob: 007674b1c310041ec81359da1995ed540fd1263b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
let b:ale_linters = { 'rust': ['analyzer'] }
let b:ale_rust_analyzer_config = { 'checkOnSave': { 'command': 'clippy' } }
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