diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2019-03-04 09:15:44 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2019-03-04 09:15:44 +0100 |
commit | ed677c34d55a0e025b7008f29419498a3989cde2 (patch) | |
tree | 62efef78ed05b2b4e61efb21e40a6b337359eb8e /ftplugin/rust.vim | |
parent | c161994e9607399a7b365ab274592bfc4f100306 (diff) | |
download | vim-polyglot-ed677c34d55a0e025b7008f29419498a3989cde2.tar.gz vim-polyglot-ed677c34d55a0e025b7008f29419498a3989cde2.zip |
Update
Diffstat (limited to 'ftplugin/rust.vim')
-rw-r--r-- | ftplugin/rust.vim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim index cdc318f1..fa9e1562 100644 --- a/ftplugin/rust.vim +++ b/ftplugin/rust.vim @@ -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+=<:> |