This commit is contained in:
Adam Stankiewicz
2019-03-04 09:15:44 +01:00
parent c161994e96
commit ed677c34d5
45 changed files with 1575 additions and 705 deletions

View File

@@ -5,7 +5,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Maintainer: Kevin Ballard <kevin@sb.org>
" Last Change: June 08, 2016
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
if exists("b:did_ftplugin")
finish
@@ -54,8 +54,8 @@ if get(g:, 'rust_recommended_style', 1)
setlocal textwidth=99
endif
" This includeexpr isn't perfect, but it's a good start
setlocal includeexpr=substitute(v:fname,'::','/','g')
setlocal include=\\v^\\s*(pub\\s+)?use\\s+\\zs(\\f\|:)+
setlocal includeexpr=rust#IncludeExpr(v:fname)
setlocal suffixesadd=.rs
@@ -149,7 +149,7 @@ endif
" Cleanup {{{1
let b:undo_ftplugin = "
\ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
\ setlocal formatoptions< comments< commentstring< include< includeexpr< suffixesadd<
\|if exists('b:rust_set_style')
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
\|endif
@@ -188,7 +188,7 @@ let b:undo_ftplugin = "
" Code formatting on save
augroup rust.vim.PreWrite
autocmd!
autocmd BufWritePre <buffer> silent! call rustfmt#PreWrite()
autocmd BufWritePre *.rs silent! call rustfmt#PreWrite()
augroup END
setlocal matchpairs+=<:>