git://git.iain.cx/iain
/
profile.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added cinoptions.
[profile.git]
/
.vimrc
diff --git
a/.vimrc
b/.vimrc
old mode 100755
(executable)
new mode 100644
(file)
index
c594723
..
3396ecd
--- a/
.vimrc
+++ b/
.vimrc
@@
-39,6
+39,7
@@
se laststatus=2
" Use C indent style.
se cindent
se cinkeys=0{,0},0),:,!^F,o,O,e
" Use C indent style.
se cindent
se cinkeys=0{,0},0),:,!^F,o,O,e
+se cinoptions=b1,c2
" GUI options.
se go=aglmr
" GUI options.
se go=aglmr
@@
-98,6
+99,9
@@
fun! Iain_Vars()
if ! exists("b:iainhex")
let b:iainhex = 0
endif
if ! exists("b:iainhex")
let b:iainhex = 0
endif
+ if ! exists("b:iainverbose")
+ let b:iainverbose = 0
+ endif
endfun
" Helper for status line.
endfun
" Helper for status line.
@@
-146,12
+150,17
@@
endfun
fun! Show_StatusLine()
call Iain_Vars()
let sl1='%2n\:\ %<%f\ [%{Show_List()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%Y%M%R]\ %='
fun! Show_StatusLine()
call Iain_Vars()
let sl1='%2n\:\ %<%f\ [%{Show_List()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%Y%M%R]\ %='
- let sl
2='\ \|\ P:%4.6o\
L:%4.6l/%-4.6L\ C:%3.6c\ \|\ %P'
+ let sl
3='
L:%4.6l/%-4.6L\ C:%3.6c\ \|\ %P'
let hexformat='%b'
if b:iainhex
let hexformat='0\x%02B'
endif
let hexformat='%b'
if b:iainhex
let hexformat='0\x%02B'
endif
- exec "set statusline=" . sl1 . hexformat . sl2
+ if b:iainverbose
+ let sl2=hexformat . '\ \|\ P:%4.6o\ '
+ else
+ let sl2=''
+ endif
+ exec "set statusline=" . sl1 . sl2 . sl3
endfun
" Restore window size.
endfun
" Restore window size.
@@
-219,9
+228,6
@@
endif
if version >= "600"
version 6.0
if version >= "600"
version 6.0
-" Allow room for numbers.
-se numberwidth=5
-
" Track changing number mode.
let g:numbercols=&columns
let g:numberchanges=0
" Track changing number mode.
let g:numbercols=&columns
let g:numberchanges=0
@@
-279,9
+285,17
@@
fun! Cycle_HexStatusLine()
call Show_StatusLine()
endfun
call Show_StatusLine()
endfun
+" Cycle verbose display of toolbar stuff.
+fun! Cycle_VerboseStatusLine()
+ call Iain_Vars()
+ let b:iainverbose = ! b:iainverbose
+ call Show_StatusLine()
+endfun
+
" Cycle between number mode.
" FIXME: Toggling in a split window doesn't work properly. We need to track
" the number of windows and number modes. Something for later...
" Cycle between number mode.
" FIXME: Toggling in a split window doesn't work properly. We need to track
" the number of windows and number modes. Something for later...
+" Perhaps have a redraw callback that checks width and original column number.
fun! Cycle_Number()
if &number
" Restore width.
fun! Cycle_Number()
if &number
" Restore width.
@@
-304,7
+318,13
@@
fun! Cycle_Number()
" Expand if this was the first change.
if g:numberchanges == 0
let g:numbercols=&columns
" Expand if this was the first change.
if g:numberchanges == 0
let g:numbercols=&columns
- let &columns=&columns+&numberwidth
+ if version >= 700
+ " Expand column by our preferred width.
+ let &columns=&columns+&numberwidth
+ else
+ " Vim 6 hardcodes width to 8.
+ let &columns=&columns+8
+ endif
endif
" Track changes.
endif
" Track changes.
@@
-338,6
+358,8
@@
map Qf :se foldenable!<CR>:<CR>
map Qp :se paste!<CR>:<CR>
" Swap hex/decimal statusline with Qx
map Qx :call Cycle_HexStatusLine()<CR>:<CR>
map Qp :se paste!<CR>:<CR>
" Swap hex/decimal statusline with Qx
map Qx :call Cycle_HexStatusLine()<CR>:<CR>
+" Change statusline verbosity with Qv
+map Qv :call Cycle_VerboseStatusLine()<CR>:<CR>
" Swap case-sensitivity with Qc.
map Qc :call Invert_Case()<CR>:<CR>
" Cycle list styles with Ql.
" Swap case-sensitivity with Qc.
map Qc :call Invert_Case()<CR>:<CR>
" Cycle list styles with Ql.
@@
-346,6
+368,8
@@
map Ql :call Cycle_List()<CR>:<CR>
map Qn :call Cycle_Number()<CR>:<CR>
" Toggle tags with Qt.
map Qt :Tlist<CR>
map Qn :call Cycle_Number()<CR>:<CR>
" Toggle tags with Qt.
map Qt :Tlist<CR>
+" Clear search pattern with Q/.
+map Q/ :let @/=""<CR>:<CR>
" Leaving Perl mode.
fun! PerlMode_unmap()
" Leaving Perl mode.
fun! PerlMode_unmap()
@@
-361,6
+385,9
@@
endif
if version >= "700"
version 7.0
if version >= "700"
version 7.0
+" Set size of numbers column.
+se numberwidth=5
+
" Add "previous tab" mapping as gb.
map gb :tabPrev<CR>
endif
" Add "previous tab" mapping as gb.
map gb :tabPrev<CR>
endif