This is a vim plugin that provides Rust file detection, syntax highlighting, and (optional) autoformatting.
Using Vundle
- Add
Plugin 'rust-lang/rust.vim'
to~/.vimrc
vim +PluginInstall +qall
Note: Vundle will not automatically detect Rust files properly if filetype on
is executed before Vundle. Please check the quickstart for more
details.
Using Pathogen
git clone --depth=1 https://github.com/rust-lang/rust.vim.git ~/.vim/bundle/rust.vim
Using NeoBundle
- Add
NeoBundle 'rust-lang/rust.vim'
to~/.vimrc
- Re-open vim or execute
:source ~/.vimrc
This plugin can optionally format your code using [rustfmt][rfmt] every time a
buffer is written. Simple put let g:rustfmt_autosave = 1
in your .vimrc
.
Further help can be found in the documentation with :Helptags
then :help rust
.
Like Rust, rust.vim is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details.