summaryrefslogtreecommitdiffstats
path: root/ftplugin/rust.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2014-08-27 18:16:33 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2014-08-27 18:16:33 +0200
commitbd35da8e9ca0bddd95539bef0c8f4857dc4cc746 (patch)
tree2eda075ecdbeb5a05a536c3a91272559ee936989 /ftplugin/rust.vim
parent91da1ec2a5e8fb926535160ef4644ff879d3ee08 (diff)
downloadvim-polyglot-1.10.1.tar.gz
vim-polyglot-1.10.1.zip
Updatev1.10.1
Diffstat (limited to 'ftplugin/rust.vim')
-rw-r--r--ftplugin/rust.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim
index 39edc1f9..09eaf62d 100644
--- a/ftplugin/rust.vim
+++ b/ftplugin/rust.vim
@@ -56,6 +56,21 @@ if exists("g:loaded_delimitMate")
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
endif
+if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
+ let b:rust_set_foldmethod=1
+ setlocal foldmethod=syntax
+ if g:rust_fold == 2
+ setlocal foldlevel<
+ else
+ setlocal foldlevel=99
+ endif
+endif
+
+if has('conceal') && exists('g:rust_conceal')
+ let b:rust_set_conceallevel=1
+ setlocal conceallevel=2
+endif
+
" Motion Commands {{{1
" Bind motion commands to support hanging indents
@@ -103,6 +118,14 @@ let b:undo_ftplugin = "
\|else
\|unlet! b:delimitMate_excluded_regions
\|endif
+ \|if exists('b:rust_set_foldmethod')
+ \|setlocal foldmethod< foldlevel<
+ \|unlet b:rust_set_foldmethod
+ \|endif
+ \|if exists('b:rust_set_conceallevel')
+ \|setlocal conceallevel<
+ \|unlet b:rust_set_conceallevel
+ \|endif
\|unlet! b:rust_last_rustc_args b:rust_last_args
\|delcommand RustRun
\|delcommand RustExpand