summaryrefslogtreecommitdiff
path: root/ftplugin
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-04-11 11:43:15 +0100
committerAkshay <[email protected]>2021-04-11 11:43:15 +0100
commit0467a5fd6ff7380a11a25885de3ae8adb7a7cc7f (patch)
tree8b5c5a3c5cad33c56a794f9143eaa8fbc038a250 /ftplugin
parent808539a80f123df92600aeaaa499614a4d102613 (diff)
delete rust.vim, add quickfix support for clippy and cargo
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/rust.vim28
1 files changed, 28 insertions, 0 deletions
diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim
index cfd90ec..7443f9d 100644
--- a/ftplugin/rust.vim
+++ b/ftplugin/rust.vim
@@ -1 +1,29 @@
1setlocal ts=4 sts=4 sw=4 expandtab 1setlocal ts=4 sts=4 sw=4 expandtab
2
3set formatprg=rustfmt
4
5" set makeprg=cargo\ clippy
6set errorformat=
7 \%-G,
8 \%-Gerror:\ aborting\ %.%#,
9 \%-Gerror:\ Could\ not\ compile\ %.%#,
10 \%Eerror:\ %m,
11 \%Eerror[E%n]:\ %m,
12 \%Wwarning:\ %m,
13 \%Inote:\ %m,
14 \%C\ %#-->\ %f:%l:%c,
15 \%E\ \ left:%m,%C\ right:%m\ %f:%l:%c,%Z
16
17function! RustMake() abort
18 set makeprg=nix-shell\ --run\ \"cargo\ build\"
19 silent! make
20 set makeprg=nix-shell\ --run\ \"cargo\ clippy\"
21 silent! make
22endfunction
23
24nnoremap <leader>r :call RustMake() <bar> silent! redraw <bar> cwindow<cr>
25
26augroup RustFmt
27 autocmd!
28 autocmd BufWritePost *.rs | silent exec "!cargo fmt" | bufdo edit | silent! redraw
29augroup END