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>
77 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
78 " Handle options only available in Vim 5 and above.
79 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
83 " Tell Vim we use dark backgrounds in our terminals.
84 if ! has("gui_running")
88 " Allow mouse use in a terminal but only if it can work.
89 if has("xterm_clipboard")
93 " Update more quickly. For use with sign highlighting as polling for
94 " CursorMove makes redrawing slow.
99 " Enable tab-completion prompting for commands.
101 " Don't list object files when globbing files to load.
102 se wildignore+=*.o,*.obj
103 " So there's no need to assign them low priority.
104 se suffixes-=*.o,*.obj
106 " Save sessions in UNIX format with / as file separator. This is
110 " How often do we need to use ^A/^X on octals?
113 " Nuke any pre-existing autocommands.
126 " Save the current window width so we can restore it when we quit.
127 if ! exists("g:oldcols")
128 let g:oldcols=&columns
131 " More GUI options. Add icon and tearoffs.
135 " Allow dynamic window resize even if we aren't in an xterm.
136 se t_WS=
\e[8;%p1%d;%p2%dt
138 " Highlight search results.
141 " Set graphical window title.
142 se titlestring=%{Show_TitleString()}
144 " Syntax highlighting. New versions will use syn enable instead.
154 " Set up our variables.
156 if ! exists("b:iainlist")
159 if ! exists("b:iainhex")
162 if ! exists("b:iainverbose")
163 let b:iainverbose = 0
165 if ! exists("b:iainstatus")
166 " Window Flags: (F)ocused, (I)nsert mode, Cursor (H)old.
167 let b:iainstatus = "Fih"
169 if ! exists("g:iainextracolumns")
170 let g:iainextracolumns = 0
173 if ! exists("g:marksigns")
176 if ! exists("g:firstsign")
177 let g:firstsign = 100
182 " Helper for status line.
183 " Show space, underscore or dollar sign depending on list mode.
189 elseif b:iainlist == 1
198 " Helper for status line.
199 " Show c or C to denote case-sensitivity.
208 " Helper for status line.
209 " Show the size of the tabstop.
214 " Helper for status line.
215 " Show p when paste mode is on.
224 " Show the window title.
225 fun! Show_TitleString()
229 let l:ts1=printf("%2d: %s", bufnr(""), expand('%t'))
231 return printf("%s (%s) %s", l:ts1, getcwd(), v:servername)
234 " Show the status line.
235 fun! Show_StatusLine()
237 let l:sl1='%2n\:\ %<%f\ [%{Show_List()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%Y%M%R]\ %='
238 let l:sl3='L:%4.6l/%-4.6L\ C:%3.6c\ \|\ %P'
241 let l:hexformat='0\x%02B'
244 let l:sl2=l:hexformat . '\ \|\ P:%4.6o\ '
248 exec "set statusline=" . l:sl1 . l:sl2 . l:sl3
251 " Toggle case-sensitivity.
256 " Grow or shrink the window size.
257 fun! Resize_Columns(op, ...)
259 " Vim 5 hardcodes the size of numbers column to 8.
261 let l:columns = &numberwidth
269 exe "let l:resize=" . &columns . a:op . l:columns
270 let l:resize = "se columns=" . l:resize
272 " HACK: Inside screen there is an extra line for the status bar. Vim
273 " manages the resize by sending an escape sequence to set the number of
274 " lines and number of columns in one action. To do this it will first query
275 " the number of lines and then set <same number of lines> by <new number of
276 " columns>. Because of the extra line for the status bar this results in
277 " the real terminal being shrunk by a line. We ask for the terminal to grow
278 " by a line so it ends up actually being the same.
279 if &term =~ '^screen'
280 let l:resize = l:resize . " lines=" . (&lines + 1)
286 " Toggle number display.
289 let &number = ! &number
293 let l:num_numbers = 0
294 while l:i <= winnr("$")
295 if getwinvar(l:i, "&number") == 1
296 let l:num_numbers = l:num_numbers + 1
301 if l:num_numbers == 0
302 let g:iainextracolumns = 0
304 call Resize_Columns("-")
306 elseif g:iainextracolumns == 0
307 let g:iainextracolumns = 1
309 call Resize_Columns("+")
315 " Restore window size.
316 au Display VimLeave * if exists("g:oldcols") | call Resize_Columns("-", (&columns - g:oldcols)) | endif
319 au Mode BufEnter * if &ft == "make" | call MakeMode_map() | endif
320 au Mode BufLeave * if &ft == "make" | call MakeMode_unmap() | endif
322 " Entering Make mode.
332 fun! MakeMode_unmap()
338 " Show the status line for the first time.
339 call Show_StatusLine()
341 " Function to create mappings with either a hardcoded \ or <Leader>.
342 fun! Mapping(keysequence,mapping)
344 exec "map \\" . a:keysequence . " " . a:mapping
346 exec "map <Leader>" . a:keysequence . " " . a:mapping
350 " Use - and = to create underlines.
351 call Mapping("-", "yyp:s/./-/g<RETURN>:let @/=''<RETURN>:<RETURN>")
352 call Mapping("=", "yyp:s/./=/g<RETURN>:let @/=''<RETURN>:<RETURN>")
354 " Change to ts=2 with \2.
355 call Mapping("2", ":se ts=2<CR>:<CR>")
356 " Change to ts=4 with \4.
357 call Mapping("4", ":se ts=4<CR>:<CR>")
358 " Change to ts=8 with \8.
359 call Mapping("8", ":se ts=8<CR>:<CR>")
360 " Change to ts=16 with \6.
361 call Mapping("6", ":se ts=16<CR>:<CR>")
362 " Change to ts=32 with \3.
363 call Mapping("3", ":se ts=32<CR>:<CR>")
364 " Toggle paste mode with \p.
365 call Mapping("p", ":se paste!<CR>:<CR>")
366 " Swap case-sensitivity with \c.
367 call Mapping("c", ":call Invert_Case()<CR>:<CR>")
368 " Change number mode with \n.
369 call Mapping("n", ":call Number(1)<CR>:<CR>")
370 " Expand or shrink window size with \> and \<.
371 call Mapping(">", ":call Resize_Columns('+')<CR>:<CR>")
372 call Mapping("<", ":call Resize_Columns('-')<CR>:<CR>")
373 " Clear search pattern with \/.
374 call Mapping("/", ":let @/=\"\"<CR>:<CR>")
376 " Forget the Ex mode mapping.
379 " Vim tip 99: What's the highlighting group under the cursor?
380 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>")
382 fun! Uncluttered_Buffer()
383 if exists("uncluttered_buffer")
384 if uncluttered_buffer == 1
403 if &ft == 'gitcommit'
410 fun! Startup_Resize()
413 " Resize for numbers.
416 let l:columns = &numberwidth
426 let l:columns = l:columns + 2
431 if g:oldcols < (80 + l:columns)
432 call Resize_Columns("+", l:columns)
436 " Show numbers by default.
437 au Display VimEnter * if ! Uncluttered_Buffer() | call Number(0) | endif
440 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
441 " Handle options only available in Vim 6 and above.
442 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
446 " Remember quickfix state.
449 " Set indenting by filetype.
452 " Less intrusive syntax highlighting.
456 if has("gui_running")
459 se guifont=DejaVu_Sans_Mono:h10:cANSI
461 se guifont=DejaVu\ Sans\ Mono\ 10
466 if has("gui_running") || &t_Co > 16
473 " Ignore whitespace when diffing.
474 se diffopt=filler,iwhite
476 " Expand window when doing a vertical diff.
479 let &columns = &columns * 2
483 " Remember that we are opening the quickfix window.
484 au Mode BufWinEnter quickfix let g:quickfixing=1
485 au Mode BufUnload * if &ft == "qf" | let g:quickfixing=0 | endif
487 " Allow in-place editing of crontabs.
488 au Mode FileType crontab set backupcopy=yes
490 " Make * and # work the way you expect in visual mode.
491 vnoremap * y/\V<C-R>=substitute(escape(@@,"/\\"),"\n","\\\\n","ge")<CR><CR>
492 vnoremap # y?\V<C-R>=substitute(escape(@@,"?\\"),"\n","\\\\n","ge")<CR><CR>
494 " Set mark and update highlighting.
496 au Signs BufEnter * call <SID>Highlight_Signs()
497 au Signs CursorHold * call <SID>Highlight_Signs()
500 fun! <SID>Prep_Signs()
501 if ! exists("b:signdot") || ! g:marksigns
504 if ! exists("b:signdash") || ! g:marksigns
507 if ! exists("b:signquote") || ! g:marksigns
510 if ! exists("b:signcaret") || ! g:marksigns
513 if ! exists("b:signless") || ! g:marksigns
516 if ! exists("b:signgreater") || ! g:marksigns
519 if ! exists("b:signleft") || ! g:marksigns
522 if ! exists("b:signright") || ! g:marksigns
525 if ! exists("b:signsquareleft") || ! g:marksigns
526 let b:signsquareleft=0
528 if ! exists("b:signsquareright") || ! g:marksigns
529 let b:signsquareright=0
531 if ! exists("b:signbraceleft") || ! g:marksigns
532 let b:signbraceleft=0
534 if ! exists("b:signbraceright") || ! g:marksigns
535 let b:signbraceright=0
537 if ! exists("b:signa") || ! g:marksigns
540 if ! exists("b:signb") || ! g:marksigns
543 if ! exists("b:signc") || ! g:marksigns
546 if ! exists("b:signd") || ! g:marksigns
549 if ! exists("b:signe") || ! g:marksigns
552 if ! exists("b:signf") || ! g:marksigns
555 if ! exists("b:signA") || ! g:marksigns
558 if ! exists("b:signB") || ! g:marksigns
561 if ! exists("b:signC") || ! g:marksigns
564 if ! exists("b:signD") || ! g:marksigns
567 if ! exists("b:signE") || ! g:marksigns
570 if ! exists("b:signF") || ! g:marksigns
575 fun! <SID>Place_Sign(number, line, old, name)
580 exe "sign unplace " . (g:firstsign + a:number) . " buffer=" . bufnr("")
581 " Don't place the sign if it would conflict with the last change sign.
582 exe "sign place " . (g:firstsign + a:number) . " line=" . a:line . " name=" . a:name . " buffer=" . bufnr("")
586 fun! <SID>Highlight_Signs(...)
587 if ! has("signs") || ! g:marksigns || Uncluttered_Buffer()
591 call <SID>Prep_Signs()
593 let b:signdot = <SID>Place_Sign(0, line("'."), b:signdot, "MarkDot")
594 let b:signdash = <SID>Place_Sign(1, line("''"), b:signdash, "MarkDash")
595 let b:signquote = <SID>Place_Sign(2, line("'\""), b:signquote, "MarkQuote")
596 let b:signcaret = <SID>Place_Sign(3, line("'^"), b:signcaret, "MarkCaret")
597 let b:signless = <SID>Place_Sign(4, line("'<"), b:signless, "MarkLess")
598 let b:signgreater = <SID>Place_Sign(5, line("'>"), b:signgreater, "MarkGreater")
599 let b:signleft = <SID>Place_Sign(6, line("'("), b:signleft, "MarkLeft")
600 let b:signright = <SID>Place_Sign(7, line("')"), b:signright, "MarkRight")
601 let b:signsquareleft = <SID>Place_Sign(8, line("'["), b:signsquareleft, "MarkSquareLeft")
602 let b:signsquareright = <SID>Place_Sign(9, line("']"), b:signsquareright, "MarkSquareRight")
603 let b:signbraceleft = <SID>Place_Sign(10, line("'{"), b:signbraceleft, "MarkBraceLeft")
604 let b:signbraceright = <SID>Place_Sign(11, line("'}"), b:signbraceright, "MarkBraceRight")
606 let b:signa = <SID>Place_Sign(12, line("'a"), b:signa, "Marka")
607 let b:signb = <SID>Place_Sign(13, line("'b"), b:signb, "Markb")
608 let b:signc = <SID>Place_Sign(15, line("'c"), b:signc, "Markc")
609 let b:signd = <SID>Place_Sign(16, line("'d"), b:signd, "Markd")
610 let b:signe = <SID>Place_Sign(17, line("'e"), b:signe, "Marke")
611 let b:signf = <SID>Place_Sign(18, line("'f"), b:signf, "Markf")
612 let b:signA = <SID>Place_Sign(19, line("'A"), b:signA, "MarkA")
613 let b:signB = <SID>Place_Sign(20, line("'B"), b:signB, "MarkB")
614 let b:signC = <SID>Place_Sign(21, line("'C"), b:signC, "MarkC")
615 let b:signD = <SID>Place_Sign(22, line("'D"), b:signD, "MarkD")
616 let b:signE = <SID>Place_Sign(23, line("'E"), b:signE, "MarkE")
617 let b:signF = <SID>Place_Sign(24, line("'F"), b:signF, "MarkF")
621 fun! <SID>Cycle_Signs(resize)
626 let g:marksigns = ! g:marksigns
629 " Signs to highlight marks.
630 " Syntax won't work properly in Vim 6.
631 sign define MarkDash text=' texthl=MarkSign
632 sign define MarkDot text=* texthl=MarkDot
633 sign define MarkQuote text=" texthl=MarkSign
634 sign define MarkCaret text=^ texthl=MarkDot
635 sign define MarkLess text=< texthl=MarkSign
636 sign define MarkGreater text=> texthl=MarkSign
637 sign define MarkLeft text=( texthl=MarkSign
638 sign define MarkRight text=) texthl=MarkSign
639 sign define MarkSquareLeft text=[ texthl=MarkSign
640 sign define MarkSquareRight text=] texthl=MarkSign
641 sign define MarkBraceLeft text={ texthl=MarkSign
642 sign define MarkBraceRight text=} texthl=MarkSign
643 sign define Marka text=a texthl=MarkSign linehl=MarkLine
644 sign define Markb text=b texthl=MarkSign linehl=MarkLine
645 sign define Markc text=c texthl=MarkSign linehl=MarkLine
646 sign define Markd text=d texthl=MarkSign linehl=MarkLine
647 sign define Marke text=e texthl=MarkSign linehl=MarkLine
648 sign define Markf text=f texthl=MarkSign linehl=MarkLine
649 sign define MarkA text=A texthl=MarkSign linehl=MarkLine
650 sign define MarkB text=B texthl=MarkSign linehl=MarkLine
651 sign define MarkC text=C texthl=MarkSign linehl=MarkLine
652 sign define MarkD text=D texthl=MarkSign linehl=MarkLine
653 sign define MarkE text=E texthl=MarkSign linehl=MarkLine
654 sign define MarkF text=F texthl=MarkSign linehl=MarkLine
657 call Resize_Columns("+", 2)
659 call <SID>Highlight_Signs()
661 exe "sign unplace " . (g:firstsign + 0)
662 exe "sign unplace " . (g:firstsign + 1)
663 exe "sign unplace " . (g:firstsign + 2)
664 exe "sign unplace " . (g:firstsign + 3)
665 exe "sign unplace " . (g:firstsign + 4)
666 exe "sign unplace " . (g:firstsign + 5)
667 exe "sign unplace " . (g:firstsign + 6)
668 exe "sign unplace " . (g:firstsign + 7)
669 exe "sign unplace " . (g:firstsign + 8)
670 exe "sign unplace " . (g:firstsign + 9)
671 exe "sign unplace " . (g:firstsign + 10)
672 exe "sign unplace " . (g:firstsign + 11)
673 exe "sign unplace " . (g:firstsign + 12)
674 exe "sign unplace " . (g:firstsign + 13)
675 exe "sign unplace " . (g:firstsign + 14)
676 exe "sign unplace " . (g:firstsign + 15)
677 exe "sign unplace " . (g:firstsign + 16)
678 exe "sign unplace " . (g:firstsign + 17)
679 exe "sign unplace " . (g:firstsign + 18)
680 exe "sign unplace " . (g:firstsign + 19)
681 exe "sign unplace " . (g:firstsign + 20)
682 exe "sign unplace " . (g:firstsign + 21)
683 exe "sign unplace " . (g:firstsign + 22)
684 exe "sign unplace " . (g:firstsign + 23)
685 exe "sign unplace " . (g:firstsign + 24)
687 sign undefine MarkDash
688 sign undefine MarkDot
689 sign undefine MarkQuote
690 sign undefine MarkCaret
691 sign undefine MarkLess
692 sign undefine MarkGreater
693 sign undefine MarkLeft
694 sign undefine MarkRight
695 sign undefine MarkSquareLeft
696 sign undefine MarkSquareRight
697 sign undefine MarkBraceLeft
698 sign undefine MarkBraceRight
712 call <SID>Prep_Signs()
714 call Resize_Columns("-", 2)
721 " Pretty UTF-8 listchars.
722 if has('multi_byte') && (&tenc =~? '^u\(tf\|cs\)' || (! strlen(&tenc) && &enc =~? '^u\(tf\|cs\)')) && v:version >= "602"
723 let basic='tab:»·,trail:…,extends:«,precedes:»'
726 let basic=basic . ',nbsp:•'
729 let basic='tab:\\_,trail:_,extends:<,precedes:>'
732 let basic=basic . ',nbsp:+'
736 let b:iainlist = b:iainlist + 1
742 elseif b:iainlist == 1
743 exec "set lcs=" . basic
746 exec "set lcs=" . basic . "," . eol
751 " Cycle between hex and decimal display of toolbar stuff.
752 fun! Cycle_HexStatusLine()
754 let b:iainhex = ! b:iainhex
755 call Show_StatusLine()
758 " Cycle verbose display of toolbar stuff.
759 fun! Cycle_VerboseStatusLine()
761 let b:iainverbose = ! b:iainverbose
762 call Show_StatusLine()
765 " Toggle quickfix window.
766 fun! Cycle_Quickfix()
767 if g:quickfixing == 1
775 " Swap hex/decimal statusline with \x.
776 call Mapping("x", ":call Cycle_HexStatusLine()<CR>:<CR>")
777 " Change statusline verbosity with \v.
778 call Mapping("v", ":call Cycle_VerboseStatusLine()<CR>:<CR>")
779 " Cycle list styles with \l.
780 call Mapping("l", ":call Cycle_List()<CR>:<CR>")
781 " Toggle tags with \t.
782 call Mapping("t", ":Tlist<CR>")
783 " Change foldmethod with \f.
784 call Mapping("f", ":se foldenable!<CR>:<CR>")
785 " Toggle quickfix window with \q.
786 call Mapping("q", ":call Cycle_Quickfix()<CR>:<CR>")
787 " Rerun filetype detection with \s. The s is for syntax, as this will be
788 " updated as a side-effect.
789 call Mapping("s", ":filetype detect<CR>:<CR>")
790 " Toggle marks with \m.
791 call Mapping("m", ":call <SID>Cycle_Signs(1)<CR>:<CR>")
793 fun! <SID>Iain_Colour(colour)
795 if a:colour == "darkblue"
797 elseif a:colour == "darkmagenta"
799 elseif a:colour == "darkred"
801 elseif a:colour == "red"
805 if a:colour == "darkblue"
807 elseif a:colour == "darkmagenta"
809 elseif a:colour == "darkred"
811 elseif a:colour == "red"
819 " Change status bar colour when various things happen.
820 " Flags: H/h: Cursor held/moved.
821 " F/f: Focus gained/lost.
822 " I/i: Insert mode entered/left.
823 fun! Highlight_StatusLine(flag)
824 " Get current status.
827 " Change the status based on the flag. XXX: Does Vim let us to do flags?
828 let re = "[" . tolower(a:flag) . toupper(a:flag) . "]"
829 let b:iainstatus = substitute(b:iainstatus, re, a:flag, "")
831 let l:normalcolour = "darkblue"
832 let l:editingcolour = "darkmagenta"
833 let l:warningcolour = "darkred"
834 let l:readonlycolour = "red"
837 let l:colour = l:normalcolour
838 " Maybe override depending on status.
839 if b:iainstatus =~# "H"
840 if b:iainstatus =~# "I"
841 " Held in insert mode. Add extra highlight if we don't have focus.
842 if b:iainstatus =~# "f"
843 let l:colour = l:warningcolour
845 let l:colour = l:editingcolour
849 if b:iainstatus =~# "I"
850 " Regular insert mode.
851 let l:colour = l:editingcolour
855 " Override again if readonly.
856 if l:colour != l:normalcolour
857 if getbufvar("", "&ro")
858 let l:colour = l:readonlycolour
862 let l:termcolour = <SID>Iain_Colour(l:colour)
864 exec "highlight StatusLine gui=bold term=bold cterm=bold guifg=white guibg=" . l:colour . " ctermfg=white ctermbg=" . l:termcolour
867 au Display VimEnter * call Highlight_StatusLine("")
869 " Show signs by default.
870 au Display VimEnter * call <SID>Cycle_Signs(0)
873 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
874 " Handle options only available in Vim 7 and above.
875 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
879 " Helper to show tab name.
880 fun! <SID>TabName(label, gui)
881 let l:label = a:label
883 let l:label = "No Name"
885 let l:label = "[" . l:label . "]"
888 let l:label = fnamemodify(l:label, ":t")
889 if strlen(l:label) >= 18
890 let l:label = l:label[0:17] . ".."
896 " Find out if any buffer was modified.
897 fun! <SID>TabModified(buflist)
899 while l:i < len(a:buflist)
900 if getbufvar(a:buflist[l:i], "&modified") == 1
910 let l:s = "%#TabLineFill#Tabs:"
913 while l:i < tabpagenr("$")
916 let l:buflist = tabpagebuflist(l:i)
917 let l:winnr = tabpagewinnr(l:i)
918 let l:n = tabpagewinnr(l:i, "$")
919 let l:label = <SID>TabName(bufname(l:buflist[l:winnr - 1]), 0)
920 let l:modified = <SID>TabModified(l:buflist)
922 " Choose highlighting.
923 if l:i == tabpagenr()
924 let l:s .= "%#TabLineSel#[" . l:n . l:modified . " " . l:label . "]"
926 let l:s .= "%#TabLine# " . l:n . l:modified . " " . l:label . " "
931 let l:s .= "%#TabLine#%T"
935 " Per tab label for the GUI.
936 fun! Show_GUITabLine()
937 let l:buflist = tabpagebuflist(v:lnum)
938 let l:winnr = tabpagewinnr(v:lnum)
939 let l:s = tabpagewinnr(v:lnum, "$")
940 let l:label = <SID>TabName(bufname(l:buflist[l:winnr - 1]), 1)
941 let l:modified = <SID>TabModified(l:buflist)
943 let l:s .= l:modified . " " . l:label
947 se tabline=%!Show_TabLine()
948 se guitablabel=%!Show_GUITabLine()
950 au StatusLine CursorHoldI * call Highlight_StatusLine("H")
951 au StatusLine CursorMovedI * call Highlight_StatusLine("h")
952 au StatusLine FocusGained * call Highlight_StatusLine("F")
953 au StatusLine FocusLost * call Highlight_StatusLine("f")
954 au StatusLine InsertEnter * call Highlight_StatusLine("I")
955 au StatusLine InsertLeave * call Highlight_StatusLine("i")
958 au Signs InsertEnter * call <SID>Highlight_Signs()
959 au Signs InsertLeave * call <SID>Highlight_Signs()
962 " Limit the size of the popup menu when completing.
965 " Make diffs vertical by default.
968 " Set size of numbers column.
971 " Add "previous tab" mapping as gb.
972 map gb :tabprevious<CR>:<CR>
979 " Yet more GUI options. Add tabs.
984 let g:p4Presets='P4CONFIG'
988 " Resize after startup.
989 au Display VimEnter * call Startup_Resize()