diff options
author | Akshay <[email protected]> | 2021-09-19 10:57:34 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-09-19 10:57:34 +0100 |
commit | 456232000cc2a5f20b5eb87f268ffea2e3667ac6 (patch) | |
tree | 6d183309a3e5f51e74fd963d9e1881c5f12b6bc8 /ftplugin | |
parent | c45237c7394152dc63200f7eb71e816b30600d82 (diff) |
cool new search mapping
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/rust.vim | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim index 5007055..fce69b4 100644 --- a/ftplugin/rust.vim +++ b/ftplugin/rust.vim | |||
@@ -1,8 +1,6 @@ | |||
1 | setlocal ts=4 sts=4 sw=4 expandtab | 1 | setlocal ts=4 sts=4 sw=4 expandtab |
2 | 2 | ||
3 | set formatprg=rustfmt | 3 | set formatprg=rustfmt |
4 | |||
5 | " set makeprg=cargo\ clippy | ||
6 | set errorformat= | 4 | set errorformat= |
7 | \%-G, | 5 | \%-G, |
8 | \%-Gerror:\ aborting\ %.%#, | 6 | \%-Gerror:\ aborting\ %.%#, |
@@ -22,19 +20,3 @@ function! RustMake() abort | |||
22 | endfunction | 20 | endfunction |
23 | 21 | ||
24 | nnoremap <leader>r :call RustMake() <bar> silent! redraw <bar> cwindow<cr> | 22 | nnoremap <leader>r :call RustMake() <bar> silent! redraw <bar> cwindow<cr> |
25 | |||
26 | if exists('*RustFmtSimple') | ||
27 | finish | ||
28 | endif | ||
29 | |||
30 | function! RustFmtSimple() abort | ||
31 | let s = winsaveview() | ||
32 | bufdo! silent! !rustfmt % | ||
33 | bufdo! edit | ||
34 | call winrestview(s) | ||
35 | endfunction | ||
36 | |||
37 | augroup SimpleRustFmt | ||
38 | autocmd! | ||
39 | autocmd BufWritePost *.rs call RustFmtSimple() | ||
40 | augroup END | ||