Loading ...
Sorry, an error occurred while loading the content.

Re: if.. exitsts query

Expand Messages
  • Hari Krishna Dara
    ... I have this in my vimrc which I hope you also find useful: aug BottomScrollBar au! function! s:CheckBottomScrollBar() if (! &wrap && has( GUI )) set
    Message 1 of 6 , Mar 30, 2005
    • 0 Attachment
      On Tue, 29 Mar 2005 at 6:28pm, Bruce Golling wrote:

      > Hello,
      > I am trying to set up a condition in my gvimrc.
      > I wanted do something similar to
      > psuedo-code follows:
      > " if wordwrap is on
      > then turn off the bottom slider
      > else turn on the bottom slider"
      > I can't seem to figure out the correct syntax for the
      > "if exists ('wrap')"
      >
      > If anyone can even understand what I'm trying to say,
      > I hope you can lend me a hand.
      > Thanks
      > Bruce Golling
      >

      I have this in my vimrc which I hope you also find useful:

      aug BottomScrollBar
      au!

      function! s:CheckBottomScrollBar()
      if (! &wrap && has('GUI'))
      set guioptions+=b
      else
      set guioptions-=b
      endif
      endfunction

      au WinEnter * :call <SID>CheckBottomScrollBar()
      au BufWinEnter * :call <SID>CheckBottomScrollBar()
      aug END

      This turns on/off the scrollbar based on the 'wrap' setting in the
      current window. This creates a bit of a flash or a noticeable redraw,
      but nothing terrible.

      --
      HTH,
      Hari



      __________________________________
      Do you Yahoo!?
      Yahoo! Small Business - Try our new resources site!
      http://smallbusiness.yahoo.com/resources/
    Your message has been successfully submitted and would be delivered to recipients shortly.