refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / vim-rust / README.md
1 ---
2 title: vim-rust
3 homepage: https://github.com/rust-lang/rust.vim
4 tagline: |
5   vim-rust (rust.vim) adds Rust language support for Vim.
6 ---
7
8 To update (replacing the current version) run `webi vim-rust`.
9
10 ## Cheat Sheet
11
12 > `vim-rust` provides integration with `cargo check`, `rustfmt`, and other rust
13 > tooling.
14
15 You'll also need to install [`ALE`](https://webinstall.dev/vim-ale) (part of
16 [`vim-essentials`](https://webinstall.dev/vim-essentials)) or
17 [`syntastic`](https://webinstall.dev/vim-syntastic) first.
18
19 ### How to install and configure by hand
20
21 1. Remove the previous version of rust.vim, if any:
22    ```bash
23    rm -rf ~/.vim/pack/plugins/start/rust.vim
24    ```
25 2. Install `rust.vim` as a Vim8 package with `git`:
26    ```bash
27    mkdir -p ~/.vim/pack/plugins/start/
28    git clone --depth=1 \
29        https://github.com/rust-lang/rust.vim \
30        ~/.vim/pack/plugins/start/rust.vim
31    ```
32 3. Create `~/.vim/plugins/rust.vim`, as follows:
33
34    ```vim
35    " Reasonable defaults for rust.vim
36
37    " run rustfmt on save
38    let g:rustfmt_autosave = 1
39
40    " run cargo check et al
41    let g:ale_rust_cargo_use_check = 1
42    let g:ale_rust_cargo_check_tests = 1
43    let g:ale_rust_cargo_check_examples = 1
44    ```
45
46 4. Edit `~/.vimrc` to include the config:
47    ```vim
48    " Rust: reasonable defaults for rust.vim
49    source ~/.vim/plugins/rust.vim
50    ```