Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/etc/vim/ftplugin/rust.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
" Vim syntax file
" Language: Rust
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Last Change: 2013 Jul 10
" Maintainer: William Ting <io@williamting.com>
" Last Change: 2014 Jan 12

if exists("b:did_ftplugin")
finish
Expand Down Expand Up @@ -42,4 +43,16 @@ if exists("g:loaded_delimitMate")
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
endif

let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd< | if exists('b:rust_original_delimitMate_excluded_regions') | let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions | unlet b:rust_original_delimitMate_excluded_regions | elseif exists('b:delimitMate_excluded_regions') | unlet b:delimitMate_excluded_regions | endif"
" Bind motion commands to support hanging indents
noremap <silent> <buffer> [[ ?{<CR>w99[{
noremap <silent> <buffer> ]] j0?{<CR>w99[{%/{<CR>

let b:undo_ftplugin = "
\ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
\ | if exists('b:rust_original_delimitMate_excluded_regions')
\ | let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
\ | unlet b:rust_original_delimitMate_excluded_regions
\ | elseif exists('b:delimitMate_excluded_regions')
\ | unlet b:delimitMate_excluded_regions
\ | endif
\ | unmap <buffer> [[|unmap <buffer> ]]"