+ if &ft == 'svn'
+ return 1
+ endif
+
+ if &ft == 'gitcommit'
+ return 1
+ endif
+
+ return 0
+endfun "}}}2
+
+fun! Startup_Resize() "{{{2
+ let l:columns = 0
+
+ " Resize for numbers.
+ if &number
+ if version >= "700"
+ let l:columns = &numberwidth
+ else
+ let l:columns = 8
+ endif
+ endif
+
+ " Resize for signs.
+ if has("signs")
+ if g:marksigns
+ if version >= "600"
+ let l:columns = l:columns + 2
+ endif
+ endif
+ endif
+
+ if g:oldcols < (80 + l:columns)
+ call Resize_Columns("+", l:columns)
+ endif
+endfun "}}}2
+
+" Show numbers by default.
+au Display VimEnter * if ! Uncluttered_Buffer() | call Number(0) | endif
+
+" Position the compview plugin window.
+au Display BufEnter -SearchResults- set buftype=nowrite | set nonumber | wincmd J
+endif "}}}1
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Handle options only available in Vim 6 and above.
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+if version >= "600" "{{{1
+version 6.0
+
+if has("win32")
+ se encoding=utf-8
+endif
+
+" Remember quickfix state.
+let g:quickfixing=0
+
+" Set indenting by filetype.
+filetype indent on
+
+" Less intrusive syntax highlighting.
+syn enable
+
+" Set colours.
+if has("gui_running")
+ try
+ if has("win32")
+ se guifont=DejaVu_Sans_Mono:h10:cANSI
+ else
+ se guifont=DejaVu\ Sans\ Mono\ 10
+ endif
+ catch
+ endtry
+endif
+if has("gui_running") || &t_Co > 16
+ try
+ colo iain
+ catch
+ endtry
+endif
+
+" Ignore whitespace when diffing.
+se diffopt=filler,iwhite
+
+" Expand window when doing a vertical diff.
+if &diff
+ if &columns < 161
+ let &columns = &columns * 2
+ endif
+endif
+
+" Remember that we are opening the quickfix window.
+au Mode BufWinEnter quickfix let g:quickfixing=1
+au Mode BufUnload * if &ft == "qf" | let g:quickfixing=0 | endif
+
+" Allow in-place editing of crontabs.
+au Mode FileType crontab set backupcopy=yes
+
+" Make * and # work the way you expect in visual mode.
+vnoremap * y/\V<C-R>=substitute(escape(@@,"/\\"),"\n","\\\\n","ge")<CR><CR>
+vnoremap # y?\V<C-R>=substitute(escape(@@,"?\\"),"\n","\\\\n","ge")<CR><CR>
+
+" Set mark and update highlighting.
+if has("signs")
+ au Signs BufReadPost * call <SID>Highlight_Signs()
+ au Signs CursorHold * call <SID>Highlight_Signs()
+endif
+
+" Helper to set buffer variable for a given sign.
+fun! <SID>Prep_Sign(sign) "{{{2
+ if ! exists("b:sign" . a:sign) || ! g:marksigns
+ exe "let b:sign" . a:sign . "=0"
+ endif
+endfun "}}}2
+
+fun! <SID>Prep_Signs() "{{{2
+ call <SID>Prep_Sign("dot")
+ call <SID>Prep_Sign("dash")
+ call <SID>Prep_Sign("quote")
+ call <SID>Prep_Sign("caret")
+ call <SID>Prep_Sign("less")
+ call <SID>Prep_Sign("greater")
+ call <SID>Prep_Sign("left")
+ call <SID>Prep_Sign("right")
+ call <SID>Prep_Sign("squareleft")
+ call <SID>Prep_Sign("squareright")
+ call <SID>Prep_Sign("braceleft")
+ call <SID>Prep_Sign("braceright")
+ call <SID>Prep_Sign("a")
+ call <SID>Prep_Sign("b")
+ call <SID>Prep_Sign("c")
+ call <SID>Prep_Sign("d")
+ call <SID>Prep_Sign("e")
+ call <SID>Prep_Sign("f")
+ call <SID>Prep_Sign("A")
+ call <SID>Prep_Sign("B")
+ call <SID>Prep_Sign("C")
+ call <SID>Prep_Sign("D")
+ call <SID>Prep_Sign("E")
+ call <SID>Prep_Sign("F")
+endfun! "}}}2
+
+fun! <SID>Place_Sign(number, line, old, name) "{{{2
+ if a:line == a:old
+ return a:old
+ endif
+
+ exe "sign unplace " . (g:firstsign + a:number) . " buffer=" . bufnr("")
+ " Don't place the sign if it would conflict with the last change sign.
+ exe "sign place " . (g:firstsign + a:number) . " line=" . a:line . " name=" . a:name . " buffer=" . bufnr("")
+ return a:line
+endfun "}}}2
+
+fun! <SID>Highlight_Signs(...) "{{{2
+ if ! has("signs") || ! g:marksigns || Uncluttered_Buffer()
+ return
+ endif
+
+ call <SID>Prep_Signs()
+
+ let b:signdot = <SID>Place_Sign(0, line("'."), b:signdot, "MarkDot")
+ let b:signdash = <SID>Place_Sign(1, line("''"), b:signdash, "MarkDash")
+ let b:signquote = <SID>Place_Sign(2, line("'\""), b:signquote, "MarkQuote")
+ let b:signcaret = <SID>Place_Sign(3, line("'^"), b:signcaret, "MarkCaret")
+ let b:signless = <SID>Place_Sign(4, line("'<"), b:signless, "MarkLess")
+ let b:signgreater = <SID>Place_Sign(5, line("'>"), b:signgreater, "MarkGreater")
+ let b:signleft = <SID>Place_Sign(6, line("'("), b:signleft, "MarkLeft")
+ let b:signright = <SID>Place_Sign(7, line("')"), b:signright, "MarkRight")
+ let b:signsquareleft = <SID>Place_Sign(8, line("'["), b:signsquareleft, "MarkSquareLeft")
+ let b:signsquareright = <SID>Place_Sign(9, line("']"), b:signsquareright, "MarkSquareRight")
+ let b:signbraceleft = <SID>Place_Sign(10, line("'{"), b:signbraceleft, "MarkBraceLeft")
+ let b:signbraceright = <SID>Place_Sign(11, line("'}"), b:signbraceright, "MarkBraceRight")
+
+ let b:signa = <SID>Place_Sign(12, line("'a"), b:signa, "Marka")
+ let b:signb = <SID>Place_Sign(13, line("'b"), b:signb, "Markb")
+ let b:signc = <SID>Place_Sign(15, line("'c"), b:signc, "Markc")
+ let b:signd = <SID>Place_Sign(16, line("'d"), b:signd, "Markd")
+ let b:signe = <SID>Place_Sign(17, line("'e"), b:signe, "Marke")
+ let b:signf = <SID>Place_Sign(18, line("'f"), b:signf, "Markf")
+ let b:signA = <SID>Place_Sign(19, line("'A"), b:signA, "MarkA")
+ let b:signB = <SID>Place_Sign(20, line("'B"), b:signB, "MarkB")
+ let b:signC = <SID>Place_Sign(21, line("'C"), b:signC, "MarkC")
+ let b:signD = <SID>Place_Sign(22, line("'D"), b:signD, "MarkD")
+ let b:signE = <SID>Place_Sign(23, line("'E"), b:signE, "MarkE")
+ let b:signF = <SID>Place_Sign(24, line("'F"), b:signF, "MarkF")
+endfun "}}}2
+
+" Toggle signs.
+fun! <SID>Cycle_Signs(resize) "{{{2
+ if ! has("signs")
+ return
+ endif