summaryrefslogtreecommitdiffstats
path: root/vim/ftplugin/rust.vim
blob: 292f0084cc814ea4a58fe1e936d1e67f009dae33 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
let b:ale_linters = { 'rust': ['rls'] }
let b:ale_rust_rls_toolchain = 'stable'
let b:ale_rust_rls_config = { 'rust': { 'clippy_preference': 'on' } }
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