From: Iain Patterson Date: Wed, 20 Jun 2007 08:54:41 +0000 (+0000) Subject: Vim 6 hardcodes numberwidth to 8. X-Git-Url: http://git.iain.cx/?p=profile.git;a=commitdiff_plain;h=b06e3bd3f984e445593d218b659d9597bdaddcaa Vim 6 hardcodes numberwidth to 8. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@55 6be0d1a5-5cfe-0310-89b6-964be062b18b --- diff --git a/.vimrc b/.vimrc index c594723..5b9308d 100755 --- a/.vimrc +++ b/.vimrc @@ -219,9 +219,6 @@ endif 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 @@ -282,6 +279,7 @@ 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... +" Perhaps have a redraw callback that checks width and original column number. fun! Cycle_Number() if &number " Restore width. @@ -304,7 +302,13 @@ fun! Cycle_Number() " 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. @@ -361,6 +365,9 @@ endif if version >= "700" version 7.0 +" Set size of numbers column. +se numberwidth=5 + " Add "previous tab" mapping as gb. map gb :tabPrev endif