9 se cinkeys=0{,0},0),:,!^F,o,O,e
20 se guifont=Bitstream\ Vera\ Sans\ Mono\ 12
23 highlight StatusLine guifg=white guibg=blue ctermbg=white ctermfg=blue
25 se guifont=Bitstream_Vera_Sans_Mono:h10:cANSI
29 " Set up our variables.
31 if ! exists("b:iainlist") | let b:iainlist = 0 | endif
32 if ! exists("b:iainhex") | let b:iainhex = 1 | endif
37 let b:iainlist = b:iainlist + 1
38 if b:iainlist > 2 | let b:iainlist = 0 | endif
41 elseif b:iainlist == 1
42 set lcs=tab:\\_,trail:_,extends:<,precedes:>
45 set lcs=tab:\\_,trail:_,extends:<,precedes:>,eol:$
55 elseif b:iainlist == 1
64 " Cycle between hex and decimal display of toolbar stuff.
65 fun! Cycle_StatusLine()
67 let b:iainhex = ! b:iainhex
69 set statusline=%2n\:\ %<%f\ [%{Show_List()}%{Show_Case()}%{Show_Tabstop()}%Y%M%R]\ %=0\x%02B\ (%3.6c,%-4.6l)\ 0\x%04.6O\ \|\ %4.6L\ %P
71 set statusline=%2n\:\ %<%f\ [%{Show_List()}%{Show_Case()}%{Show_Tabstop()}%Y%M%R]\ %=%b\ (%3.6c,%-4.6l)\ %4.6o\ \|\ %4.6L\ %P
75 " Save the current window width so if we change it we can restore it
77 let andyoldcols=&columns
79 " This expands the terminal to display two 80-column files side-by-side
80 " when vim is opened in diff mode.
81 if &diff | let &columns = 164 | endif
83 map <C-"> viwvbi"<ESC>ea"<ESC>
84 map - yyp:s/./-/g<RETURN>:let @/=''<RETURN>:<RETURN>
85 map = yyp:s/./=/g<RETURN>:let @/=''<RETURN>:<RETURN>
89 " Make * and # work the way you expect in visual mode.
90 vnoremap * y/\V<C-R>=substitute(escape(@@,"/\\"),"\n","\\\\n","ge")<CR><CR>
91 vnoremap # y?\V<C-R>=substitute(escape(@@,"?\\"),"\n","\\\\n","ge")<CR><CR>
98 if &ic | return "c" | else | return "C" | endif
105 " Clear Q as we will use it for commands.
108 " Swap hex/decimal statusline with Qx
109 map Qx :call Cycle_StatusLine()<CR>:<CR>
110 " Swap case-sensitivity with Qc.
111 map Qc :call Invert_Case()<CR>:<CR>
112 " Cycle list styles with Ql.
113 map Ql :call Cycle_List()<CR>:<CR>
114 " Change to ts=2 with Q2.
115 map Q2 :se ts=2<CR>:<CR>
116 " Change to ts=4 with Q4.
117 map Q4 :se ts=4<CR>:<CR>
118 " Change to ts=8 with Q8.
119 map Q8 :se ts=8<CR>:<CR>
121 " Vim 7 has tabs. Default "next tab" mapping is gt. Add "previous tab" as gb.
124 call Cycle_StatusLine()
126 au VimLeave * if exists("andyoldcols") | let &columns=andyoldcols | endif
128 " Autocommands to setup features we only want in certain modes...
130 " ... For C/C++ files:
132 au BufEnter * if &ft == "c" || &ft == "cpp" | call CMode_map() | endif
133 au BufLeave * if &ft == "c" || &ft == "cpp" | call CMode_unmap() | endif
135 " ... For Perl files:
137 au BufEnter * if &ft == "perl" | call PerlMode_map() | endif
138 au BufLeave * if &ft == "perl" | call PerlMode_unmap() | endif
142 au BufEnter * if &ft == "make" | call MakeMode_map() | endif
143 au BufLeave * if &ft == "make" | call MakeMode_unmap() | endif
145 " Functions to call when we enter/leave a programming language buffer...
147 " ... For C-like languages:
150 set cinkeys=0{,0},:,0#,!^F,o,O,e
151 set cinwords=if,else,while,do,for,switch
160 set cinkeys=0{,0},:,!^F,o,O,e
161 set cinwords=if,else,while,do,for,eval
164 fun! PerlMode_unmap()
165 set foldmethod=manual
175 fun! MakeMode_unmap()