diff options
| author | bors <bors@rust-lang.org> | 2013-07-09 08:43:32 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-07-09 08:43:32 -0700 |
| commit | 0a1fc4561ca37163b6bb29aaa1715b2264df40b7 (patch) | |
| tree | d72f4c1a7ee5ae30e7f6ce784893f7b15b1c1b5d /src/etc/vim/ftplugin/rust.vim | |
| parent | 62bb843e3239844f25faff59065fa28c59a3ffac (diff) | |
| parent | 121ae82be0c008e342bcae4e776f14671a2807b7 (diff) | |
| download | rust-0a1fc4561ca37163b6bb29aaa1715b2264df40b7.tar.gz rust-0a1fc4561ca37163b6bb29aaa1715b2264df40b7.zip | |
auto merge of #7665 : chris-morgan/rust/better-vim-support, r=cmr
General tweaks for Vim support, especially proper indenting.
Diffstat (limited to 'src/etc/vim/ftplugin/rust.vim')
| -rw-r--r-- | src/etc/vim/ftplugin/rust.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/etc/vim/ftplugin/rust.vim b/src/etc/vim/ftplugin/rust.vim new file mode 100644 index 00000000000..f329dd6ce02 --- /dev/null +++ b/src/etc/vim/ftplugin/rust.vim @@ -0,0 +1,25 @@ +" Vim syntax file +" Language: Rust +" Maintainer: Chris Morgan <me@chrismorgan.info> +" Last Change: 2013 Jul 6 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=s1:/*,mb:*,ex:*/,:///,://!,:// +setlocal commentstring=//%s +setlocal formatoptions-=t formatoptions+=croqnlj + +" This includeexpr isn't perfect, but it's a good start +setlocal includeexpr=substitute(v:fname,'::','/','g') + +" NOT adding .rc as it's being phased out (0.7) +setlocal suffixesadd=.rs + +if exists("g:ftplugin_rust_source_path") + let &l:path=g:ftplugin_rust_source_path . ',' . &l:path +endif + +let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<" |
