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 let l:ts1=printf("%2d: %s", bufnr(""), expand('%t'))
235 return printf("%s (%s) %s", l:ts1, getcwd(), v:servername)
238 " Show the status line.
239 fun! Show_StatusLine()
241 let l:sl1='%2n\:\ %<%f\ [%{Show_List()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%Y%M%R]\ %='
242 let l:sl3='L:%4.6l/%-4.6L\ C:%3.6c\ \|\ %P'
245 let l:hexformat='0\x%02B'
248 let l:sl2=l:hexformat . '\ \|\ P:%4.6o\ '
252 exec "set statusline=" . l:sl1 . l:sl2 . l:sl3
255 " Toggle case-sensitivity.
260 " Grow or shrink the window size.
261 fun! Resize_Columns(op, ...)
263 " Vim 5 hardcodes the size of numbers column to 8.
265 let l:columns = &numberwidth
273 exe "let l:resize=" . &columns . a:op . l:columns
274 let l:resize = "se columns=" . l:resize
276 " HACK: Inside screen there is an extra line for the status bar. Vim
277 " manages the resize by sending an escape sequence to set the number of
278 " lines and number of columns in one action. To do this it will first query
279 " the number of lines and then set <same number of lines> by <new number of
280 " columns>. Because of the extra line for the status bar this results in
281 " the real terminal being shrunk by a line. We ask for the terminal to grow
282 " by a line so it ends up actually being the same.
283 if &term =~ '^screen'
284 let l:resize = l:resize . " lines=" . (&lines + 1)
290 " Toggle number display.
293 let &number = ! &number
297 let l:num_numbers = 0
298 while l:i <= winnr("$")
299 if getwinvar(l:i, "&number") == 1
300 let l:num_numbers = l:num_numbers + 1
305 if l:num_numbers == 0
306 let g:iainextracolumns = 0
308 call Resize_Columns("-")
310 elseif g:iainextracolumns == 0
311 let g:iainextracolumns = 1
313 call Resize_Columns("+")
319 " Restore window size.
320 au Display VimLeave * if exists("g:oldcols") | call Resize_Columns("-", (&columns - g:oldcols)) | endif
323 au Mode BufEnter * if &ft == "make" | call MakeMode_map() | endif
324 au Mode BufLeave * if &ft == "make" | call MakeMode_unmap() | endif
326 " Entering Make mode.
336 fun! MakeMode_unmap()
342 " Show the status line for the first time.
343 call Show_StatusLine()
345 " Function to create mappings with either a hardcoded \ or <Leader>.
346 fun! Mapping(keysequence,mapping)
348 exec "map \\" . a:keysequence . " " . a:mapping
350 exec "map <Leader>" . a:keysequence . " " . a:mapping
354 " Use - and = to create underlines.
355 call Mapping("-", "yyp:s/./-/g<RETURN>:let @/=''<RETURN>:<RETURN>")
356 call Mapping("=", "yyp:s/./=/g<RETURN>:let @/=''<RETURN>:<RETURN>")
358 " Change to ts=2 with \2.
359 call Mapping("2", ":se ts=2<CR>:<CR>")
360 " Change to ts=4 with \4.
361 call Mapping("4", ":se ts=4<CR>:<CR>")
362 " Change to ts=8 with \8.
363 call Mapping("8", ":se ts=8<CR>:<CR>")
364 " Change to ts=16 with \6.
365 call Mapping("6", ":se ts=16<CR>:<CR>")
366 " Change to ts=32 with \3.
367 call Mapping("3", ":se ts=32<CR>:<CR>")
368 " Toggle paste mode with \p.
369 call Mapping("p", ":se paste!<CR>:<CR>")
370 " Swap case-sensitivity with \c.
371 call Mapping("c", ":call Invert_Case()<CR>:<CR>")
372 " Change number mode with \n.
373 call Mapping("n", ":call Number(1)<CR>:<CR>")
374 " Expand or shrink window size with \> and \<.
375 call Mapping(">", ":call Resize_Columns('+')<CR>:<CR>")
376 call Mapping("<", ":call Resize_Columns('-')<CR>:<CR>")
377 " Clear search pattern with \/.
378 call Mapping("/", ":let @/=\"\"<CR>:<CR>")
380 " Forget the Ex mode mapping.
383 " Vim tip 99: What's the highlighting group under the cursor?
384 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>")
386 fun! Uncluttered_Buffer()
387 if exists("uncluttered_buffer")
388 if uncluttered_buffer == 1
407 if &ft == 'gitcommit'
414 fun! Startup_Resize()
417 " Resize for numbers.
420 let l:columns = &numberwidth
430 let l:columns = l:columns + 2
435 if g:oldcols < (80 + l:columns)
436 call Resize_Columns("+", l:columns)
440 " Show numbers by default.
441 au Display VimEnter * if ! Uncluttered_Buffer() | call Number(0) | endif
444 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
445 " Handle options only available in Vim 6 and above.
446 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
450 " Remember quickfix state.
453 " Set indenting by filetype.
456 " Less intrusive syntax highlighting.
460 if has("gui_running")
463 se guifont=DejaVu_Sans_Mono:h10:cANSI
465 se guifont=DejaVu\ Sans\ Mono\ 10
470 if has("gui_running") || &t_Co > 16
477 " Ignore whitespace when diffing.
478 se diffopt=filler,iwhite
480 " Expand window when doing a vertical diff.
483 let &columns = &columns * 2
487 " Remember that we are opening the quickfix window.
488 au Mode BufWinEnter quickfix let g:quickfixing=1
489 au Mode BufUnload * if &ft == "qf" | let g:quickfixing=0 | endif
491 " Allow in-place editing of crontabs.
492 au Mode FileType crontab set backupcopy=yes
494 " Make * and # work the way you expect in visual mode.
495 vnoremap * y/\V<C-R>=substitute(escape(@@,"/\\"),"\n","\\\\n","ge")<CR><CR>
496 vnoremap # y?\V<C-R>=substitute(escape(@@,"?\\"),"\n","\\\\n","ge")<CR><CR>
498 " Set mark and update highlighting.
500 au Signs BufEnter * call <SID>Highlight_Signs()
501 au Signs CursorHold * call <SID>Highlight_Signs()
504 fun! <SID>Prep_Signs()
505 if ! exists("b:signdot") || ! g:marksigns
508 if ! exists("b:signdash") || ! g:marksigns
511 if ! exists("b:signquote") || ! g:marksigns
514 if ! exists("b:signcaret") || ! g:marksigns
517 if ! exists("b:signless") || ! g:marksigns
520 if ! exists("b:signgreater") || ! g:marksigns
523 if ! exists("b:signleft") || ! g:marksigns
526 if ! exists("b:signright") || ! g:marksigns
529 if ! exists("b:signsquareleft") || ! g:marksigns
530 let b:signsquareleft=0
532 if ! exists("b:signsquareright") || ! g:marksigns
533 let b:signsquareright=0
535 if ! exists("b:signbraceleft") || ! g:marksigns
536 let b:signbraceleft=0
538 if ! exists("b:signbraceright") || ! g:marksigns
539 let b:signbraceright=0
541 if ! exists("b:signa") || ! g:marksigns
544 if ! exists("b:signb") || ! g:marksigns
547 if ! exists("b:signc") || ! g:marksigns
550 if ! exists("b:signd") || ! g:marksigns
553 if ! exists("b:signe") || ! g:marksigns
556 if ! exists("b:signf") || ! g:marksigns
559 if ! exists("b:signA") || ! g:marksigns
562 if ! exists("b:signB") || ! g:marksigns
565 if ! exists("b:signC") || ! g:marksigns
568 if ! exists("b:signD") || ! g:marksigns
571 if ! exists("b:signE") || ! g:marksigns
574 if ! exists("b:signF") || ! g:marksigns
579 fun! <SID>Place_Sign(number, line, old, name)
584 exe "sign unplace " . (g:firstsign + a:number) . " buffer=" . bufnr("")
585 " Don't place the sign if it would conflict with the last change sign.
586 exe "sign place " . (g:firstsign + a:number) . " line=" . a:line . " name=" . a:name . " buffer=" . bufnr("")
590 fun! <SID>Highlight_Signs(...)
591 if ! has("signs") || ! g:marksigns || Uncluttered_Buffer()
595 call <SID>Prep_Signs()
597 let b:signdot = <SID>Place_Sign(0, line("'."), b:signdot, "MarkDot")
598 let b:signdash = <SID>Place_Sign(1, line("''"), b:signdash, "MarkDash")
599 let b:signquote = <SID>Place_Sign(2, line("'\""), b:signquote, "MarkQuote")
600 let b:signcaret = <SID>Place_Sign(3, line("'^"), b:signcaret, "MarkCaret")
601 let b:signless = <SID>Place_Sign(4, line("'<"), b:signless, "MarkLess")
602 let b:signgreater = <SID>Place_Sign(5, line("'>"), b:signgreater, "MarkGreater")
603 let b:signleft = <SID>Place_Sign(6, line("'("), b:signleft, "MarkLeft")
604 let b:signright = <SID>Place_Sign(7, line("')"), b:signright, "MarkRight")
605 let b:signsquareleft = <SID>Place_Sign(8, line("'["), b:signsquareleft, "MarkSquareLeft")
606 let b:signsquareright = <SID>Place_Sign(9, line("']"), b:signsquareright, "MarkSquareRight")
607 let b:signbraceleft = <SID>Place_Sign(10, line("'{"), b:signbraceleft, "MarkBraceLeft")
608 let b:signbraceright = <SID>Place_Sign(11, line("'}"), b:signbraceright, "MarkBraceRight")
610 let b:signa = <SID>Place_Sign(12, line("'a"), b:signa, "Marka")
611 let b:signb = <SID>Place_Sign(13, line("'b"), b:signb, "Markb")
612 let b:signc = <SID>Place_Sign(15, line("'c"), b:signc, "Markc")
613 let b:signd = <SID>Place_Sign(16, line("'d"), b:signd, "Markd")
614 let b:signe = <SID>Place_Sign(17, line("'e"), b:signe, "Marke")
615 let b:signf = <SID>Place_Sign(18, line("'f"), b:signf, "Markf")
616 let b:signA = <SID>Place_Sign(19, line("'A"), b:signA, "MarkA")
617 let b:signB = <SID>Place_Sign(20, line("'B"), b:signB, "MarkB")
618 let b:signC = <SID>Place_Sign(21, line("'C"), b:signC, "MarkC")
619 let b:signD = <SID>Place_Sign(22, line("'D"), b:signD, "MarkD")
620 let b:signE = <SID>Place_Sign(23, line("'E"), b:signE, "MarkE")
621 let b:signF = <SID>Place_Sign(24, line("'F"), b:signF, "MarkF")
625 fun! <SID>Cycle_Signs(resize)
630 let g:marksigns = ! g:marksigns
633 " Signs to highlight marks.
634 " Syntax won't work properly in Vim 6.
635 sign define MarkDash text=' texthl=MarkSign
636 sign define MarkDot text=* texthl=MarkDot
637 sign define MarkQuote text=" texthl=MarkSign
638 sign define MarkCaret text=^ texthl=MarkDot
639 sign define MarkLess text=< texthl=MarkSign
640 sign define MarkGreater text=> texthl=MarkSign
641 sign define MarkLeft text=( texthl=MarkSign
642 sign define MarkRight text=) texthl=MarkSign
643 sign define MarkSquareLeft text=[ texthl=MarkSign
644 sign define MarkSquareRight text=] texthl=MarkSign
645 sign define MarkBraceLeft text={ texthl=MarkSign
646 sign define MarkBraceRight text=} texthl=MarkSign
647 sign define Marka text=a texthl=MarkSign linehl=MarkLine
648 sign define Markb text=b texthl=MarkSign linehl=MarkLine
649 sign define Markc text=c texthl=MarkSign linehl=MarkLine
650 sign define Markd text=d texthl=MarkSign linehl=MarkLine
651 sign define Marke text=e texthl=MarkSign linehl=MarkLine
652 sign define Markf text=f texthl=MarkSign linehl=MarkLine
653 sign define MarkA text=A texthl=MarkSign linehl=MarkLine
654 sign define MarkB text=B texthl=MarkSign linehl=MarkLine
655 sign define MarkC text=C texthl=MarkSign linehl=MarkLine
656 sign define MarkD text=D texthl=MarkSign linehl=MarkLine
657 sign define MarkE text=E texthl=MarkSign linehl=MarkLine
658 sign define MarkF text=F texthl=MarkSign linehl=MarkLine
661 call Resize_Columns("+", 2)
663 call <SID>Highlight_Signs()
665 exe "sign unplace " . (g:firstsign + 0)
666 exe "sign unplace " . (g:firstsign + 1)
667 exe "sign unplace " . (g:firstsign + 2)
668 exe "sign unplace " . (g:firstsign + 3)
669 exe "sign unplace " . (g:firstsign + 4)
670 exe "sign unplace " . (g:firstsign + 5)
671 exe "sign unplace " . (g:firstsign + 6)
672 exe "sign unplace " . (g:firstsign + 7)
673 exe "sign unplace " . (g:firstsign + 8)
674 exe "sign unplace " . (g:firstsign + 9)
675 exe "sign unplace " . (g:firstsign + 10)
676 exe "sign unplace " . (g:firstsign + 11)
677 exe "sign unplace " . (g:firstsign + 12)
678 exe "sign unplace " . (g:firstsign + 13)
679 exe "sign unplace " . (g:firstsign + 14)
680 exe "sign unplace " . (g:firstsign + 15)
681 exe "sign unplace " . (g:firstsign + 16)
682 exe "sign unplace " . (g:firstsign + 17)
683 exe "sign unplace " . (g:firstsign + 18)
684 exe "sign unplace " . (g:firstsign + 19)
685 exe "sign unplace " . (g:firstsign + 20)
686 exe "sign unplace " . (g:firstsign + 21)
687 exe "sign unplace " . (g:firstsign + 22)
688 exe "sign unplace " . (g:firstsign + 23)
689 exe "sign unplace " . (g:firstsign + 24)
691 sign undefine MarkDash
692 sign undefine MarkDot
693 sign undefine MarkQuote
694 sign undefine MarkCaret
695 sign undefine MarkLess
696 sign undefine MarkGreater
697 sign undefine MarkLeft
698 sign undefine MarkRight
699 sign undefine MarkSquareLeft
700 sign undefine MarkSquareRight
701 sign undefine MarkBraceLeft
702 sign undefine MarkBraceRight
716 call <SID>Prep_Signs()
718 call Resize_Columns("-", 2)
725 " Pretty UTF-8 listchars.
726 if has('multi_byte') && (&tenc =~? '^u\(tf\|cs\)' || (! strlen(&tenc) && &enc =~? '^u\(tf\|cs\)')) && v:version >= "602"
727 let basic='tab:»·,trail:…,extends:«,precedes:»'
730 let basic=basic . ',nbsp:•'
733 let basic='tab:\\_,trail:_,extends:<,precedes:>'
736 let basic=basic . ',nbsp:+'
740 let b:iainlist = b:iainlist + 1
746 elseif b:iainlist == 1
747 exec "set lcs=" . basic
750 exec "set lcs=" . basic . "," . eol
755 " Cycle between hex and decimal display of toolbar stuff.
756 fun! Cycle_HexStatusLine()
758 let b:iainhex = ! b:iainhex
759 call Show_StatusLine()
762 " Cycle verbose display of toolbar stuff.
763 fun! Cycle_VerboseStatusLine()
765 let b:iainverbose = ! b:iainverbose
766 call Show_StatusLine()
769 " Toggle quickfix window.
770 fun! Cycle_Quickfix()
771 if g:quickfixing == 1
779 " Swap hex/decimal statusline with \x.
780 call Mapping("x", ":call Cycle_HexStatusLine()<CR>:<CR>")
781 " Change statusline verbosity with \v.
782 call Mapping("v", ":call Cycle_VerboseStatusLine()<CR>:<CR>")
783 " Cycle list styles with \l.
784 call Mapping("l", ":call Cycle_List()<CR>:<CR>")
785 " Toggle tags with \t.
786 call Mapping("t", ":Tlist<CR>")
787 " Change foldmethod with \f.
788 call Mapping("f", ":se foldenable!<CR>:<CR>")
789 " Toggle quickfix window with \q.
790 call Mapping("q", ":call Cycle_Quickfix()<CR>:<CR>")
791 " Rerun filetype detection with \s. The s is for syntax, as this will be
792 " updated as a side-effect.
793 call Mapping("s", ":filetype detect<CR>:<CR>")
794 " Toggle marks with \m.
795 call Mapping("m", ":call <SID>Cycle_Signs(1)<CR>:<CR>")
797 fun! <SID>Iain_Colour(colour)
799 if a:colour == "darkblue"
801 elseif a:colour == "darkmagenta"
803 elseif a:colour == "darkred"
805 elseif a:colour == "red"
809 if a:colour == "darkblue"
811 elseif a:colour == "darkmagenta"
813 elseif a:colour == "darkred"
815 elseif a:colour == "red"
823 " Change status bar colour when various things happen.
824 " Flags: H/h: Cursor held/moved.
825 " F/f: Focus gained/lost.
826 " I/i: Insert mode entered/left.
827 fun! Highlight_StatusLine(flag)
828 " Get current status.
831 " Change the status based on the flag. XXX: Does Vim let us to do flags?
832 let re = "[" . tolower(a:flag) . toupper(a:flag) . "]"
833 let b:iainstatus = substitute(b:iainstatus, re, a:flag, "")
835 let l:normalcolour = "darkblue"
836 let l:editingcolour = "darkmagenta"
837 let l:warningcolour = "darkred"
838 let l:readonlycolour = "red"
841 let l:colour = l:normalcolour
842 " Maybe override depending on status.
843 if b:iainstatus =~# "H"
844 if b:iainstatus =~# "I"
845 " Held in insert mode. Add extra highlight if we don't have focus.
846 if b:iainstatus =~# "f"
847 let l:colour = l:warningcolour
849 let l:colour = l:editingcolour
853 if b:iainstatus =~# "I"
854 " Regular insert mode.
855 let l:colour = l:editingcolour
859 " Override again if readonly.
860 if l:colour != l:normalcolour
861 if getbufvar("", "&ro")
862 let l:colour = l:readonlycolour
866 let l:termcolour = <SID>Iain_Colour(l:colour)
868 exec "highlight StatusLine gui=bold term=bold cterm=bold guifg=white guibg=" . l:colour . " ctermfg=white ctermbg=" . l:termcolour
871 au Display VimEnter * call Highlight_StatusLine("")
873 " Show signs by default.
874 au Display VimEnter * call <SID>Cycle_Signs(0)
877 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
878 " Handle options only available in Vim 7 and above.
879 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
883 " Helper to show tab name.
884 fun! <SID>TabName(label, gui)
885 let l:label = a:label
887 let l:label = "No Name"
889 let l:label = "[" . l:label . "]"
892 let l:label = fnamemodify(l:label, ":t")
893 if strlen(l:label) >= 18
894 let l:label = l:label[0:17] . ".."
900 " Find out if any buffer was modified.
901 fun! <SID>TabModified(buflist)
903 while l:i < len(a:buflist)
904 if getbufvar(a:buflist[l:i], "&modified") == 1
914 let l:s = "%#TabLineFill#Tabs:"
917 while l:i < tabpagenr("$")
920 let l:buflist = tabpagebuflist(l:i)
921 let l:winnr = tabpagewinnr(l:i)
922 let l:n = tabpagewinnr(l:i, "$")
923 let l:label = <SID>TabName(bufname(l:buflist[l:winnr - 1]), 0)
924 let l:modified = <SID>TabModified(l:buflist)
926 " Choose highlighting.
927 if l:i == tabpagenr()
928 let l:s .= "%#TabLineSel#[" . l:n . l:modified . " " . l:label . "]"
930 let l:s .= "%#TabLine# " . l:n . l:modified . " " . l:label . " "
935 let l:s .= "%#TabLine#%T"
939 " Per tab label for the GUI.
940 fun! Show_GUITabLine()
941 let l:buflist = tabpagebuflist(v:lnum)
942 let l:winnr = tabpagewinnr(v:lnum)
943 let l:s = tabpagewinnr(v:lnum, "$")
944 let l:label = <SID>TabName(bufname(l:buflist[l:winnr - 1]), 1)
945 let l:modified = <SID>TabModified(l:buflist)
947 let l:s .= l:modified . " " . l:label
951 se tabline=%!Show_TabLine()
952 se guitablabel=%!Show_GUITabLine()
954 au StatusLine CursorHoldI * call Highlight_StatusLine("H")
955 au StatusLine CursorMovedI * call Highlight_StatusLine("h")
956 au StatusLine FocusGained * call Highlight_StatusLine("F")
957 au StatusLine FocusLost * call Highlight_StatusLine("f")
958 au StatusLine InsertEnter * call Highlight_StatusLine("I")
959 au StatusLine InsertLeave * call Highlight_StatusLine("i")
962 au Signs InsertEnter * call <SID>Highlight_Signs()
963 au Signs InsertLeave * call <SID>Highlight_Signs()
966 " Limit the size of the popup menu when completing.
969 " Make diffs vertical by default.
972 " Set size of numbers column.
975 " Add "previous tab" mapping as gb.
976 map gb :tabprevious<CR>:<CR>
983 " Yet more GUI options. Add tabs.
988 let g:p4Presets='P4CONFIG'
992 " Resize after startup.
993 au Display VimEnter * call Startup_Resize()