1 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2 " Multi-version vimrc compatible with version 4 and above.
3 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
5 " Note that "if <condition> | call Something() | endif" syntax is unsupported
6 " in Vim 4 so we write all our functions out the long way. It does work in
7 " autocommand definitions, however.
9 " Vim 4 complains if version isn't set in the configuration file.
12 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
13 " Handle options safe to use in version 4. Vim 4 parses but ignores the
14 " "if version" syntax used later in this file so we don't use it. No attempt
15 " is made to make this configuration compatible with Vim 3.
16 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
17 " No compatibility mode.
22 se rtp=~/.vim,$VIMRUNTIME
27 " And use spaces not tabs.
29 " And << and >> indent by 2.
31 " Backspace deletes full tab width at the start of a line.
34 " Allow backspace to delete before start of line.
37 " Don't jump to the start of the line when using H, L etc.
42 " Show partial commands in the ruler.
44 " And always show the status line.
49 se cinkeys=0{,0},0),:,!^F,o,O,e
55 " Don't be bugged by messages at the bottom of the screen.
61 " Case-insensitive search.
63 " But override by typing capitals.
66 " Look for ctags in home directory first.
67 se tags=~/.tags,./tags,tags
69 " Don't timeout waiting to interpet, eg, <ESC>OA as an escape code.
72 " Use ^B to search backward when completing.
74 " Use ^L to show matching completions but don't select one.
75 inoremap <C-l> <C-n><C-p>
81 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
82 " Handle options only available in Vim 5 and above.
83 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
87 " Tell Vim we use dark backgrounds in our terminals.
88 if ! has("gui_running")
92 " Allow mouse use in a terminal but only if it can work.
93 if has("xterm_clipboard")
97 " Update more quickly. For use with sign highlighting as polling for
98 " CursorMove makes redrawing slow.
103 " Enable tab-completion prompting for commands.
105 " Don't list object files when globbing files to load.
106 se wildignore+=*.o,*.obj
107 " So there's no need to assign them low priority.
108 se suffixes-=*.o,*.obj
110 " Save sessions in UNIX format with / as file separator. This is
114 " How often do we need to use ^A/^X on octals?
117 " Nuke any pre-existing autocommands.
130 " Save the current window width so we can restore it when we quit.
131 if ! exists("g:oldcols")
132 let g:oldcols=&columns
135 " More GUI options. Add icon and tearoffs.
139 " Allow dynamic window resize even if we aren't in an xterm.
140 se t_WS=
\e[8;%p1%d;%p2%dt
142 " Highlight search results.
145 " Set graphical window title.
146 se titlestring=%{Show_TitleString()}
148 " Syntax highlighting. New versions will use syn enable instead.
158 " Set up our variables.
160 if ! exists("b:iainlist")
163 if ! exists("b:iainhex")
166 if ! exists("b:iainverbose")
167 let b:iainverbose = 0
169 if ! exists("b:iainstatus")
170 " Window Flags: (F)ocused, (I)nsert mode, Cursor (H)old.
171 let b:iainstatus = "Fih"
173 if ! exists("g:iainextracolumns")
174 let g:iainextracolumns = 0
177 if ! exists("g:marksigns")
180 if ! exists("g:firstsign")
181 let g:firstsign = 100
186 " Helper for status line.
187 " Show space, underscore or dollar sign depending on list mode.
193 elseif b:iainlist == 1
202 " Helper for status line.
203 " Show c or C to denote case-sensitivity.
212 " Helper for status line.
213 " Show the size of the tabstop.
218 " Helper for status line.
219 " Show p when paste mode is on.
228 " Show the window title.
229 fun! Show_TitleString()
233 " Vim 5 doesn't have printf.
236 let l:ts1=" " . l:ts1
238 let l:ts1=l:ts1 . ": " . expand('%t')
240 let l:ts1=l:ts1 . " (" . getcwd() . ")"
241 if has("clientserver")
242 let l:ts1=l:ts1 . " " . v:servername
247 " Show the status line.
248 fun! Show_StatusLine()
250 let l:sl1='%2n\:\ %<%f\ [%{Show_List()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%Y%M%R]\ %='
251 let l:sl3='L:%4.6l/%-4.6L\ C:%3.6c\ \|\ %P'
254 let l:hexformat='0\x%02B'
257 let l:sl2=l:hexformat . '\ \|\ P:%4.6o\ '
261 exec "set statusline=" . l:sl1 . l:sl2 . l:sl3
264 " Toggle case-sensitivity.
269 " Grow or shrink the window size.
270 fun! Resize_Columns(op, ...)
272 " Vim 5 hardcodes the size of numbers column to 8.
274 let l:columns = &numberwidth
282 exe "let l:resize=" . &columns . a:op . l:columns
283 let l:resize = "se columns=" . l:resize
285 " HACK: Inside screen there is an extra line for the status bar. Vim
286 " manages the resize by sending an escape sequence to set the number of
287 " lines and number of columns in one action. To do this it will first query
288 " the number of lines and then set <same number of lines> by <new number of
289 " columns>. Because of the extra line for the status bar this results in
290 " the real terminal being shrunk by a line. We ask for the terminal to grow
291 " by a line so it ends up actually being the same.
292 if &term =~ '^screen'
293 let l:resize = l:resize . " lines=" . (&lines + 1)
299 " Toggle number display.
302 let &number = ! &number
306 let l:num_numbers = 0
307 while l:i <= winnr("$")
308 if getwinvar(l:i, "&number") == 1
309 let l:num_numbers = l:num_numbers + 1
314 if l:num_numbers == 0
315 let g:iainextracolumns = 0
317 call Resize_Columns("-")
319 elseif g:iainextracolumns == 0
320 let g:iainextracolumns = 1
322 call Resize_Columns("+")
328 " Restore window size.
329 au Display VimLeave * if exists("g:oldcols") | call Resize_Columns("-", (&columns - g:oldcols)) | endif
332 au Mode BufEnter * if &ft == "make" | call MakeMode_map() | endif
333 au Mode BufLeave * if &ft == "make" | call MakeMode_unmap() | endif
335 " Entering Make mode.
345 fun! MakeMode_unmap()
351 " Show the status line for the first time.
352 call Show_StatusLine()
354 " Function to create mappings with either a hardcoded \ or <Leader>.
355 fun! Mapping(keysequence,mapping)
357 exec "map \\" . a:keysequence . " " . a:mapping
359 exec "map <Leader>" . a:keysequence . " " . a:mapping
363 " Use - and = to create underlines.
364 call Mapping("-", "yyp:s/./-/g<RETURN>:let @/=''<RETURN>:<RETURN>")
365 call Mapping("=", "yyp:s/./=/g<RETURN>:let @/=''<RETURN>:<RETURN>")
367 " Change to ts=2 with \2.
368 call Mapping("2", ":se ts=2<CR>:<CR>")
369 " Change to ts=4 with \4.
370 call Mapping("4", ":se ts=4<CR>:<CR>")
371 " Change to ts=8 with \8.
372 call Mapping("8", ":se ts=8<CR>:<CR>")
373 " Change to ts=16 with \6.
374 call Mapping("6", ":se ts=16<CR>:<CR>")
375 " Change to ts=32 with \3.
376 call Mapping("3", ":se ts=32<CR>:<CR>")
377 " Toggle paste mode with \p.
378 call Mapping("p", ":se paste!<CR>:<CR>")
379 " Swap case-sensitivity with \c.
380 call Mapping("c", ":call Invert_Case()<CR>:<CR>")
381 " Change number mode with \n.
382 call Mapping("n", ":call Number(1)<CR>:<CR>")
383 " Expand or shrink window size with \> and \<.
384 call Mapping(">", ":call Resize_Columns('+')<CR>:<CR>")
385 call Mapping("<", ":call Resize_Columns('-')<CR>:<CR>")
386 " Clear search pattern with \/.
387 call Mapping("/", ":let @/=\"\"<CR>:<CR>")
389 " Forget the Ex mode mapping.
392 " Vim tip 99: What's the highlighting group under the cursor?
393 call Mapping("h", ":echo \"hi<\" . synIDattr(synID(line(\".\"),col(\".\"),1),\"name\") . '> trans<' . synIDattr(synID(line(\".\"),col(\".\"),0),\"name\") . \"> lo<\" . synIDattr(synIDtrans(synID(line(\".\"),col(\".\"),1)),\"name\") . \">\"<CR>")
395 fun! Uncluttered_Buffer()
396 if exists("uncluttered_buffer")
397 if uncluttered_buffer == 1
416 if &ft == 'gitcommit'
423 fun! Startup_Resize()
426 " Resize for numbers.
429 let l:columns = &numberwidth
439 let l:columns = l:columns + 2
444 if g:oldcols < (80 + l:columns)
445 call Resize_Columns("+", l:columns)
449 " Show numbers by default.
450 au Display VimEnter * if ! Uncluttered_Buffer() | call Number(0) | endif
453 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
454 " Handle options only available in Vim 6 and above.
455 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
463 " Remember quickfix state.
466 " Set indenting by filetype.
469 " Less intrusive syntax highlighting.
473 if has("gui_running")
476 se guifont=DejaVu_Sans_Mono:h10:cANSI
478 se guifont=DejaVu\ Sans\ Mono\ 10
483 if has("gui_running") || &t_Co > 16
490 " Ignore whitespace when diffing.
491 se diffopt=filler,iwhite
493 " Expand window when doing a vertical diff.
496 let &columns = &columns * 2
500 " Remember that we are opening the quickfix window.
501 au Mode BufWinEnter quickfix let g:quickfixing=1
502 au Mode BufUnload * if &ft == "qf" | let g:quickfixing=0 | endif
504 " Allow in-place editing of crontabs.
505 au Mode FileType crontab set backupcopy=yes
507 " Make * and # work the way you expect in visual mode.
508 vnoremap * y/\V<C-R>=substitute(escape(@@,"/\\"),"\n","\\\\n","ge")<CR><CR>
509 vnoremap # y?\V<C-R>=substitute(escape(@@,"?\\"),"\n","\\\\n","ge")<CR><CR>
511 " Set mark and update highlighting.
513 au Signs BufEnter * call <SID>Highlight_Signs()
514 au Signs CursorHold * call <SID>Highlight_Signs()
517 fun! <SID>Prep_Signs()
518 if ! exists("b:signdot") || ! g:marksigns
521 if ! exists("b:signdash") || ! g:marksigns
524 if ! exists("b:signquote") || ! g:marksigns
527 if ! exists("b:signcaret") || ! g:marksigns
530 if ! exists("b:signless") || ! g:marksigns
533 if ! exists("b:signgreater") || ! g:marksigns
536 if ! exists("b:signleft") || ! g:marksigns
539 if ! exists("b:signright") || ! g:marksigns
542 if ! exists("b:signsquareleft") || ! g:marksigns
543 let b:signsquareleft=0
545 if ! exists("b:signsquareright") || ! g:marksigns
546 let b:signsquareright=0
548 if ! exists("b:signbraceleft") || ! g:marksigns
549 let b:signbraceleft=0
551 if ! exists("b:signbraceright") || ! g:marksigns
552 let b:signbraceright=0
554 if ! exists("b:signa") || ! g:marksigns
557 if ! exists("b:signb") || ! g:marksigns
560 if ! exists("b:signc") || ! g:marksigns
563 if ! exists("b:signd") || ! g:marksigns
566 if ! exists("b:signe") || ! g:marksigns
569 if ! exists("b:signf") || ! g:marksigns
572 if ! exists("b:signA") || ! g:marksigns
575 if ! exists("b:signB") || ! g:marksigns
578 if ! exists("b:signC") || ! g:marksigns
581 if ! exists("b:signD") || ! g:marksigns
584 if ! exists("b:signE") || ! g:marksigns
587 if ! exists("b:signF") || ! g:marksigns
592 fun! <SID>Place_Sign(number, line, old, name)
597 exe "sign unplace " . (g:firstsign + a:number) . " buffer=" . bufnr("")
598 " Don't place the sign if it would conflict with the last change sign.
599 exe "sign place " . (g:firstsign + a:number) . " line=" . a:line . " name=" . a:name . " buffer=" . bufnr("")
603 fun! <SID>Highlight_Signs(...)
604 if ! has("signs") || ! g:marksigns || Uncluttered_Buffer()
608 call <SID>Prep_Signs()
610 let b:signdot = <SID>Place_Sign(0, line("'."), b:signdot, "MarkDot")
611 let b:signdash = <SID>Place_Sign(1, line("''"), b:signdash, "MarkDash")
612 let b:signquote = <SID>Place_Sign(2, line("'\""), b:signquote, "MarkQuote")
613 let b:signcaret = <SID>Place_Sign(3, line("'^"), b:signcaret, "MarkCaret")
614 let b:signless = <SID>Place_Sign(4, line("'<"), b:signless, "MarkLess")
615 let b:signgreater = <SID>Place_Sign(5, line("'>"), b:signgreater, "MarkGreater")
616 let b:signleft = <SID>Place_Sign(6, line("'("), b:signleft, "MarkLeft")
617 let b:signright = <SID>Place_Sign(7, line("')"), b:signright, "MarkRight")
618 let b:signsquareleft = <SID>Place_Sign(8, line("'["), b:signsquareleft, "MarkSquareLeft")
619 let b:signsquareright = <SID>Place_Sign(9, line("']"), b:signsquareright, "MarkSquareRight")
620 let b:signbraceleft = <SID>Place_Sign(10, line("'{"), b:signbraceleft, "MarkBraceLeft")
621 let b:signbraceright = <SID>Place_Sign(11, line("'}"), b:signbraceright, "MarkBraceRight")
623 let b:signa = <SID>Place_Sign(12, line("'a"), b:signa, "Marka")
624 let b:signb = <SID>Place_Sign(13, line("'b"), b:signb, "Markb")
625 let b:signc = <SID>Place_Sign(15, line("'c"), b:signc, "Markc")
626 let b:signd = <SID>Place_Sign(16, line("'d"), b:signd, "Markd")
627 let b:signe = <SID>Place_Sign(17, line("'e"), b:signe, "Marke")
628 let b:signf = <SID>Place_Sign(18, line("'f"), b:signf, "Markf")
629 let b:signA = <SID>Place_Sign(19, line("'A"), b:signA, "MarkA")
630 let b:signB = <SID>Place_Sign(20, line("'B"), b:signB, "MarkB")
631 let b:signC = <SID>Place_Sign(21, line("'C"), b:signC, "MarkC")
632 let b:signD = <SID>Place_Sign(22, line("'D"), b:signD, "MarkD")
633 let b:signE = <SID>Place_Sign(23, line("'E"), b:signE, "MarkE")
634 let b:signF = <SID>Place_Sign(24, line("'F"), b:signF, "MarkF")
638 fun! <SID>Cycle_Signs(resize)
643 let g:marksigns = ! g:marksigns
646 " Signs to highlight marks.
647 " Syntax won't work properly in Vim 6.
648 if <SID>Has_Unicode()
649 sign define MarkDash text=’ texthl=MarkSign
650 sign define MarkDot text=• texthl=MarkDot
651 sign define MarkQuote text=” texthl=MarkSign
653 sign define MarkDash text=' texthl=MarkSign
654 sign define MarkDot text=* texthl=MarkDot
655 sign define MarkQuote text=" texthl=MarkSign
657 sign define MarkCaret text=^ texthl=MarkDot
658 sign define MarkLess text=< texthl=MarkSign
659 sign define MarkGreater text=> texthl=MarkSign
660 sign define MarkLeft text=( texthl=MarkSign
661 sign define MarkRight text=) texthl=MarkSign
662 sign define MarkSquareLeft text=[ texthl=MarkSign
663 sign define MarkSquareRight text=] texthl=MarkSign
664 sign define MarkBraceLeft text={ texthl=MarkSign
665 sign define MarkBraceRight text=} texthl=MarkSign
666 sign define Marka text=a texthl=MarkSign linehl=MarkLine
667 sign define Markb text=b texthl=MarkSign linehl=MarkLine
668 sign define Markc text=c texthl=MarkSign linehl=MarkLine
669 sign define Markd text=d texthl=MarkSign linehl=MarkLine
670 sign define Marke text=e texthl=MarkSign linehl=MarkLine
671 sign define Markf text=f texthl=MarkSign linehl=MarkLine
672 sign define MarkA text=A texthl=MarkSign linehl=MarkLine
673 sign define MarkB text=B texthl=MarkSign linehl=MarkLine
674 sign define MarkC text=C texthl=MarkSign linehl=MarkLine
675 sign define MarkD text=D texthl=MarkSign linehl=MarkLine
676 sign define MarkE text=E texthl=MarkSign linehl=MarkLine
677 sign define MarkF text=F texthl=MarkSign linehl=MarkLine
680 call Resize_Columns("+", 2)
682 call <SID>Highlight_Signs()
684 exe "sign unplace " . (g:firstsign + 0)
685 exe "sign unplace " . (g:firstsign + 1)
686 exe "sign unplace " . (g:firstsign + 2)
687 exe "sign unplace " . (g:firstsign + 3)
688 exe "sign unplace " . (g:firstsign + 4)
689 exe "sign unplace " . (g:firstsign + 5)
690 exe "sign unplace " . (g:firstsign + 6)
691 exe "sign unplace " . (g:firstsign + 7)
692 exe "sign unplace " . (g:firstsign + 8)
693 exe "sign unplace " . (g:firstsign + 9)
694 exe "sign unplace " . (g:firstsign + 10)
695 exe "sign unplace " . (g:firstsign + 11)
696 exe "sign unplace " . (g:firstsign + 12)
697 exe "sign unplace " . (g:firstsign + 13)
698 exe "sign unplace " . (g:firstsign + 14)
699 exe "sign unplace " . (g:firstsign + 15)
700 exe "sign unplace " . (g:firstsign + 16)
701 exe "sign unplace " . (g:firstsign + 17)
702 exe "sign unplace " . (g:firstsign + 18)
703 exe "sign unplace " . (g:firstsign + 19)
704 exe "sign unplace " . (g:firstsign + 20)
705 exe "sign unplace " . (g:firstsign + 21)
706 exe "sign unplace " . (g:firstsign + 22)
707 exe "sign unplace " . (g:firstsign + 23)
708 exe "sign unplace " . (g:firstsign + 24)
710 sign undefine MarkDash
711 sign undefine MarkDot
712 sign undefine MarkQuote
713 sign undefine MarkCaret
714 sign undefine MarkLess
715 sign undefine MarkGreater
716 sign undefine MarkLeft
717 sign undefine MarkRight
718 sign undefine MarkSquareLeft
719 sign undefine MarkSquareRight
720 sign undefine MarkBraceLeft
721 sign undefine MarkBraceRight
735 call <SID>Prep_Signs()
737 call Resize_Columns("-", 2)
742 fun! <SID>Has_Unicode()
743 if ! has('multi_byte')
751 if &tenc =~? '^u\(tf\|cs\)'
755 if ! strlen(&tenc) && &enc =~? '^u\(tf\|cs\)'
764 " Pretty UTF-8 listchars.
765 if <SID>Has_Unicode()
766 let basic='tab:»·,trail:…,extends:«,precedes:»'
769 let basic=basic . ',nbsp:•'
772 let basic='tab:\\_,trail:_,extends:<,precedes:>'
775 let basic=basic . ',nbsp:+'
779 let b:iainlist = b:iainlist + 1
785 elseif b:iainlist == 1
786 exec "set lcs=" . basic
789 exec "set lcs=" . basic . "," . eol
794 " Cycle between hex and decimal display of toolbar stuff.
795 fun! Cycle_HexStatusLine()
797 let b:iainhex = ! b:iainhex
798 call Show_StatusLine()
801 " Cycle verbose display of toolbar stuff.
802 fun! Cycle_VerboseStatusLine()
804 let b:iainverbose = ! b:iainverbose
805 call Show_StatusLine()
808 " Toggle quickfix window.
809 fun! Cycle_Quickfix()
810 if g:quickfixing == 1
818 " Swap hex/decimal statusline with \x.
819 call Mapping("x", ":call Cycle_HexStatusLine()<CR>:<CR>")
820 " Change statusline verbosity with \v.
821 call Mapping("v", ":call Cycle_VerboseStatusLine()<CR>:<CR>")
822 " Cycle list styles with \l.
823 call Mapping("l", ":call Cycle_List()<CR>:<CR>")
824 " Toggle tags with \t.
825 call Mapping("t", ":Tlist<CR>")
826 " Change foldmethod with \f.
827 call Mapping("f", ":se foldenable!<CR>:<CR>")
828 " Toggle quickfix window with \q.
829 call Mapping("q", ":call Cycle_Quickfix()<CR>:<CR>")
830 " Rerun filetype detection with \s. The s is for syntax, as this will be
831 " updated as a side-effect.
832 call Mapping("s", ":filetype detect<CR>:<CR>")
833 " Toggle marks with \m.
834 call Mapping("m", ":call <SID>Cycle_Signs(1)<CR>:<CR>")
836 fun! <SID>Iain_Colour(colour)
838 if a:colour == "darkblue"
840 elseif a:colour == "darkmagenta"
842 elseif a:colour == "darkred"
844 elseif a:colour == "red"
848 if a:colour == "darkblue"
850 elseif a:colour == "darkmagenta"
852 elseif a:colour == "darkred"
854 elseif a:colour == "red"
862 " Change status bar colour when various things happen.
863 " Flags: H/h: Cursor held/moved.
864 " F/f: Focus gained/lost.
865 " I/i: Insert mode entered/left.
866 fun! Highlight_StatusLine(flag)
867 " Get current status.
870 " Change the status based on the flag. XXX: Does Vim let us to do flags?
871 let re = "[" . tolower(a:flag) . toupper(a:flag) . "]"
872 let b:iainstatus = substitute(b:iainstatus, re, a:flag, "")
874 let l:normalcolour = "darkblue"
875 let l:editingcolour = "darkmagenta"
876 let l:warningcolour = "darkred"
877 let l:readonlycolour = "red"
880 let l:colour = l:normalcolour
881 " Maybe override depending on status.
882 if b:iainstatus =~# "H"
883 if b:iainstatus =~# "I"
884 " Held in insert mode. Add extra highlight if we don't have focus.
885 if b:iainstatus =~# "f"
886 let l:colour = l:warningcolour
888 let l:colour = l:editingcolour
892 if b:iainstatus =~# "I"
893 " Regular insert mode.
894 let l:colour = l:editingcolour
898 " Override again if readonly.
899 if l:colour != l:normalcolour
900 if getbufvar("", "&ro")
901 let l:colour = l:readonlycolour
905 let l:termcolour = <SID>Iain_Colour(l:colour)
907 exec "highlight StatusLine gui=bold term=bold cterm=bold guifg=white guibg=" . l:colour . " ctermfg=white ctermbg=" . l:termcolour
910 au Display VimEnter * call Highlight_StatusLine("")
912 " Show signs by default.
913 au Display VimEnter * call <SID>Cycle_Signs(0)
916 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
917 " Handle options only available in Vim 7 and above.
918 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
922 " Helper to show tab name.
923 fun! <SID>TabName(label, gui)
924 let l:label = a:label
926 let l:label = "No Name"
928 let l:label = "[" . l:label . "]"
931 let l:label = fnamemodify(l:label, ":t")
932 if strlen(l:label) >= 18
933 let l:label = l:label[0:17] . ".."
939 " Find out if any buffer was modified.
940 fun! <SID>TabModified(buflist)
942 while l:i < len(a:buflist)
943 if getbufvar(a:buflist[l:i], "&modified") == 1
953 let l:s = "%#TabLineFill#Tabs:"
956 while l:i < tabpagenr("$")
959 let l:buflist = tabpagebuflist(l:i)
960 let l:winnr = tabpagewinnr(l:i)
961 let l:n = tabpagewinnr(l:i, "$")
962 let l:label = <SID>TabName(bufname(l:buflist[l:winnr - 1]), 0)
963 let l:modified = <SID>TabModified(l:buflist)
965 " Choose highlighting.
966 if l:i == tabpagenr()
967 let l:s .= "%#TabLineSel#[" . l:n . l:modified . " " . l:label . "]"
969 let l:s .= "%#TabLine# " . l:n . l:modified . " " . l:label . " "
974 let l:s .= "%#TabLine#%T"
978 " Per tab label for the GUI.
979 fun! Show_GUITabLine()
980 let l:buflist = tabpagebuflist(v:lnum)
981 let l:winnr = tabpagewinnr(v:lnum)
982 let l:s = tabpagewinnr(v:lnum, "$")
983 let l:label = <SID>TabName(bufname(l:buflist[l:winnr - 1]), 1)
984 let l:modified = <SID>TabModified(l:buflist)
986 let l:s .= l:modified . " " . l:label
990 se tabline=%!Show_TabLine()
991 se guitablabel=%!Show_GUITabLine()
993 au StatusLine CursorHoldI * call Highlight_StatusLine("H")
994 au StatusLine CursorMovedI * call Highlight_StatusLine("h")
995 au StatusLine FocusGained * call Highlight_StatusLine("F")
996 au StatusLine FocusLost * call Highlight_StatusLine("f")
997 au StatusLine InsertEnter * call Highlight_StatusLine("I")
998 au StatusLine InsertLeave * call Highlight_StatusLine("i")
1001 au Signs InsertEnter * call <SID>Highlight_Signs()
1002 au Signs InsertLeave * call <SID>Highlight_Signs()
1005 " Limit the size of the popup menu when completing.
1008 " Make diffs vertical by default.
1009 se diffopt+=vertical
1011 " Set size of numbers column.
1014 " Add "previous tab" mapping as gb.
1015 map gb :tabprevious<CR>:<CR>
1018 if has("gui_macvim")
1022 " Yet more GUI options. Add tabs.
1026 let g:p4EnableMenu=1
1027 let g:p4Presets='P4CONFIG'
1031 " Resize after startup.
1032 au Display VimEnter * call Startup_Resize()