From c9f81db4b0647efd58a9f20eb300ee92735e6d67 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 8 Jul 2009 15:57:55 +0100 Subject: [PATCH] Vim fixes. Don't set mouse options if we can't get the X11 clipboard. Don't set the toolbar in gvim. Ensure we call Startup_Resize() AFTER signs and numbers have been set. Scope fix in TabModified(). --- .vimrc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.vimrc b/.vimrc index b834702..9cc96fd 100644 --- a/.vimrc +++ b/.vimrc @@ -75,8 +75,10 @@ if ! has("gui_running") se bg=dark endif -" Allow mouse use in a terminal. -se mouse=nvir +" Allow mouse use in a terminal but only if it can work. +if has("xterm_clipboard") + se mouse=nvir +endif " Update more quickly. For use with sign highlighting as polling for " CursorMove makes redrawing slow. @@ -113,8 +115,9 @@ if ! exists("g:oldcols") let g:oldcols=&columns endif -" More GUI options. Add icon, tearoffs and toolbar. -se go+=itT +" More GUI options. Add icon and tearoffs. +se go+=i +se go+=t " Allow dynamic window resize even if we aren't in an xterm. se t_WS=[8;%p1%d;%p2%dt @@ -391,9 +394,6 @@ endfun " Show numbers by default. au Display VimEnter * call Number(0) - -" Resize after startup. -au Display VimEnter * call Startup_Resize() endif """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -811,7 +811,7 @@ endfun " Find out if any buffer was modified. fun! TabModified(buflist) let l:i = 0 - while i < len(a:buflist) + while l:i < len(a:buflist) if getbufvar(a:buflist[l:i], "&modified") == 1 return "+" endif @@ -898,3 +898,8 @@ se go+=e let g:p4EnableMenu=1 let g:p4Presets='P4CONFIG' endif + +if version >= "500" +" Resize after startup. +au Display VimEnter * call Startup_Resize() +endif -- 2.20.1