diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 7157e3c..cdeb933 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -20,10 +20,7 @@ autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase -autocmd BufNewFile,BufRead .msg.[0-9]* - \ if getline(1) =~ '^From.*# This line is ignored.$' | - \ set ft=gitsendemail | - \ endif +autocmd BufNewFile,BufRead .gitsendemail.* set ft=gitsendemail autocmd BufNewFile,BufRead *.git/** \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' | \ set ft=git | diff --git a/ftplugin/csv.vim b/ftplugin/csv.vim index 82ef430..d824c15 100644 --- a/ftplugin/csv.vim +++ b/ftplugin/csv.vim @@ -2381,11 +2381,12 @@ fu! SubstituteInColumn(command, line1, line2) range "{{{3 endfu fu! ColumnMode() "{{{3 - if mode() =~# 'R' + let mode = mode() + if mode =~# 'R' " (virtual) Replace mode let new_line = (line('.') == line('$') || - \ (synIDattr(synIDtrans(synID(line("."), col("."), 1)), "name") !~# "comment")) - return "\". (new_line ? "o" : "JE".mode()) + \ (synIDattr(synIDtrans(synID(line("."), col("."), 1)), "name") =~? "comment")) + return "\g`[". (new_line ? "o" : "J".mode) else return "\" endif diff --git a/ftplugin/latex-box/folding.vim b/ftplugin/latex-box/folding.vim index 55a975f..badfc13 100644 --- a/ftplugin/latex-box/folding.vim +++ b/ftplugin/latex-box/folding.vim @@ -31,6 +31,9 @@ endif if !exists('g:LatexBox_fold_envs') let g:LatexBox_fold_envs=1 endif +if !exists('g:LatexBox_fold_envs_force') + let g:LatexBox_fold_envs_force = [] +endif if !exists('g:LatexBox_fold_parts') let g:LatexBox_fold_parts=[ \ "appendix", @@ -159,11 +162,27 @@ function! LatexBox_FoldLevel(lnum) endif " Fold environments - if g:LatexBox_fold_envs == 1 - if line =~# s:envbeginpattern + if line =~# s:envbeginpattern + if g:LatexBox_fold_envs == 1 return "a1" - elseif line =~# s:envendpattern + else + let env = matchstr(line,'\\begin\*\?{\zs\w*\*\?\ze}') + if index(g:LatexBox_fold_envs_force, env) >= 0 + return "a1" + else + return "=" + endif + endif + elseif line =~# s:envendpattern + if g:LatexBox_fold_envs == 1 return "s1" + else + let env = matchstr(line,'\\end\*\?{\zs\w*\*\?\ze}') + if index(g:LatexBox_fold_envs_force, env) >= 0 + return "s1" + else + return "=" + endif endif endif diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim index 281a63e..b70cda9 100644 --- a/ftplugin/rust.vim +++ b/ftplugin/rust.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Rust " Maintainer: Chris Morgan -" Last Change: 2013 Jul 10 +" Last Change: 2014 Feb 27 if exists("b:did_ftplugin") finish @@ -42,4 +42,55 @@ 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 +nnoremap [[ :call Rust_Jump('n', 'Back') +nnoremap ]] :call Rust_Jump('n', 'Forward') +xnoremap [[ :call Rust_Jump('v', 'Back') +xnoremap ]] :call Rust_Jump('v', 'Forward') +onoremap [[ :call Rust_Jump('o', 'Back') +onoremap ]] :call Rust_Jump('o', 'Forward') + +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 + \|nunmap [[ + \|nunmap ]] + \|xunmap [[ + \|xunmap ]] + \|ounmap [[ + \|ounmap ]] + \" + +if exists('*Rust_Jump') | finish | endif + +function! Rust_Jump(mode, function) range + let cnt = v:count1 + normal! m' + if a:mode ==# 'v' + norm! gv + endif + let foldenable = &foldenable + set nofoldenable + while cnt > 0 + execute "call Rust_Jump_" . a:function . "()" + let cnt = cnt - 1 + endwhile + let &foldenable = foldenable +endfunction + +function! Rust_Jump_Back() + call search('{', 'b') + keepjumps normal! w99[{ +endfunction + +function! Rust_Jump_Forward() + normal! j0 + call search('{', 'b') + keepjumps normal! w99[{% + call search('{') +endfunction diff --git a/indent/arduino.vim b/indent/arduino.vim new file mode 100644 index 0000000..b10e6e2 --- /dev/null +++ b/indent/arduino.vim @@ -0,0 +1,15 @@ +" Vim indent file +" Language: Arduino +" Maintainer: Kevin Sjöberg +" Last Change: 2014 Feb 28 + +" Only load this indent file when no other was loaded. +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +" C++ indenting is built-in, thus this is very simple +setlocal cindent + +let b:undo_indent = "setl cin<" diff --git a/syntax/elixir.vim b/syntax/elixir.vim index 0adf8fa..ff58d55 100644 --- a/syntax/elixir.vim +++ b/syntax/elixir.vim @@ -16,8 +16,8 @@ syn match elixirComment '#.*' contains=elixirTodo syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained syn keyword elixirKeyword is_atom is_binary is_bitstring is_boolean is_float is_function is_integer is_list is_number is_pid is_port is_record is_reference is_tuple is_exception -syn keyword elixirKeyword case cond bc lc inlist inbits if unless try receive function -syn keyword elixirKeyword exit raise throw after rescue catch else +syn keyword elixirKeyword case cond bc lc inlist inbits if unless try receive +syn keyword elixirKeyword exit raise throw after rescue catch else do end syn keyword elixirKeyword quote unquote super syn match elixirKeyword '\<\%(->\)\>\s*' diff --git a/syntax/perl.vim b/syntax/perl.vim index 4b1c89b..c7a2f4d 100644 --- a/syntax/perl.vim +++ b/syntax/perl.vim @@ -95,7 +95,7 @@ syn match perlStatementVector "\" syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>" syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>" syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\|evalbytes\)\>" -syn match perlStatementInclude "\<\%(require\|import\)\>" +syn match perlStatementInclude "\<\%(require\|import\|unimport\)\>" syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\=" syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>" syn match perlStatementSocket "\<\%(accept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>" @@ -513,7 +513,9 @@ HiLink perlStatementIndirObj perlStatement HiLink perlFunctionName perlIdentifier HiLink perlMethod perlIdentifier HiLink perlFunctionPRef perlType -HiLink perlPOD perlComment +if !get(g:, 'perl_include_pod', 1) + HiLink perlPOD perlComment +endif HiLink perlShellCommand perlString HiLink perlSpecialAscii perlSpecial HiLink perlSpecialDollar perlSpecial diff --git a/syntax/rust.vim b/syntax/rust.vim index 837a878..bd27f05 100644 --- a/syntax/rust.vim +++ b/syntax/rust.vim @@ -3,7 +3,7 @@ " Maintainer: Patrick Walton " Maintainer: Ben Blum " Maintainer: Chris Morgan -" Last Change: 2014 Feb 14 +" Last Change: 2014 Feb 27 if version < 600 syntax clear @@ -18,8 +18,8 @@ syn keyword rustOperator as syn match rustAssert "\