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()}%{Show_Paste()}%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()}%{Show_Paste()}%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
106 if &paste | return "p" | else | return "" | endif
109 " Clear Q as we will use it for commands.
112 " Swap hex/decimal statusline with Qx
113 map Qx :call Cycle_StatusLine()<CR>:<CR>
114 " Swap case-sensitivity with Qc.
115 map Qc :call Invert_Case()<CR>:<CR>
116 " Cycle list styles with Ql.
117 map Ql :call Cycle_List()<CR>:<CR>
118 " Change to ts=2 with Q2.
119 map Q2 :se ts=2<CR>:<CR>
120 " Change to ts=4 with Q4.
121 map Q4 :se ts=4<CR>:<CR>
122 " Change to ts=8 with Q8.
123 map Q8 :se ts=8<CR>:<CR>
125 " Vim 7 has tabs. Default "next tab" mapping is gt. Add "previous tab" as gb.
128 call Cycle_StatusLine()
130 au VimLeave * if exists("andyoldcols") | let &columns=andyoldcols | endif
132 " Autocommands to setup features we only want in certain modes...
134 " ... For C/C++ files:
136 au BufEnter * if &ft == "c" || &ft == "cpp" | call CMode_map() | endif
137 au BufLeave * if &ft == "c" || &ft == "cpp" | call CMode_unmap() | endif
139 " ... For Perl files:
141 au BufEnter * if &ft == "perl" | call PerlMode_map() | endif
142 au BufLeave * if &ft == "perl" | call PerlMode_unmap() | endif
146 au BufEnter * if &ft == "make" | call MakeMode_map() | endif
147 au BufLeave * if &ft == "make" | call MakeMode_unmap() | endif
149 " Functions to call when we enter/leave a programming language buffer...
151 " ... For C-like languages:
154 set cinkeys=0{,0},:,0#,!^F,o,O,e
155 set cinwords=if,else,while,do,for,switch
164 set cinkeys=0{,0},:,!^F,o,O,e
165 set cinwords=if,else,while,do,for,eval
168 fun! PerlMode_unmap()
169 set foldmethod=manual
179 fun! MakeMode_unmap()