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

BufExplorer: Hide instead of close current buffer?

Expand Messages
  • David Coppit
    Hi all, I m using WinManager, and I guess BufExplorer indirectly. I believe this is a BufExplorer question: When I double-click a file in the file list, the
    Message 1 of 4 , Feb 1, 2002
      Hi all,

      I'm using WinManager, and I guess BufExplorer indirectly. I believe
      this is a BufExplorer question:

      When I double-click a file in the file list, the current buffer is
      first closed before the selected file is opened (if the buffer is
      unmodified), or the current buffer view is split and the selected file
      is opened (if the buffer is modified).

      Is there any way to prevent the buffer from being closed if it is
      unmodified? The reason is that I often have marks, cursor position,
      view position, registers, etc. that I would rather not lose. I would
      be happy if the behavior was "always split", but I would be even
      happier if I could hide the current view and open the new view,
      replacing the current view. (Does Vim have hidden buffers?)

      This latter behavior would be like having a document maximized in a
      multi-doc Windows application, while the other docs are hidden
      "behind" the maximized document. Perhaps a modifier key along with the
      double-click would be best in order to maintain backwards
      compatibility...

      This way I could quickly switch back and forth between buffers,
      without lose editor state or having to share screen real estate.
      (I guess I'd like WinManager to work more like MS Visual Studio.)

      Thanks,
      David

      _____________________________________________________________________
      David Coppit - Ph.D. Candidate david@...
      The University of Virginia http://coppit.org/
      Whenever anyone says, "theoretically", they really mean "not really".
      - Dave Parnas
    • Tim Chase
      ... yes--it s as simple as :set (no)hidden , with nohidden being the default in the build i just downloaded--6.0 gvim for win32 i ve got enough screen real
      Message 2 of 4 , Feb 1, 2002
        >(Does Vim have hidden buffers?)

        yes--it's as simple as ":set (no)hidden" , with "nohidden" being the default
        in the build i just downloaded--6.0 gvim for win32

        i've got enough screen real estate that i usually just ^w50+ to expand my
        window to almost full screen, leaving just two lines for each other file.
        i'm almost at the point though that i would like to set "hidden" in my vimrc
        just because it would be durn handy :)

        -tim

        _________________________________________________________________
        Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
      • David Coppit
        ... Hm... That does do the trick for WinManager--thanks. I m not sure if I like the buffers left hanging around, but I guess it means fast access and maybe
        Message 3 of 4 , Feb 1, 2002
          On Fri, 1 Feb 2002, Tim Chase wrote:

          > >(Does Vim have hidden buffers?)
          >
          > yes--it's as simple as ":set (no)hidden" , with "nohidden" being the default
          > in the build i just downloaded--6.0 gvim for win32

          Hm... That does do the trick for WinManager--thanks. I'm not sure if I
          like the buffers left hanging around, but I guess it means fast access
          and maybe some memory overhead. I'd rather have a "save state for file
          on close"...

          David

          _____________________________________________________________________
          David Coppit - Ph.D. Candidate david@...
          The University of Virginia http://coppit.org/
          Whenever anyone says, "theoretically", they really mean "not really".
          - Dave Parnas
        • Bindu.Wavell@econvergent.com
          You might find the following setting very usefull in your .vimrc: au BufWinLeave *.c,*.cpp,*.h mkview au BufWinEnter *.c,*.cpp,*.h silent loadview I m not sure
          Message 4 of 4 , Feb 3, 2002

            You might find the following setting very usefull in your .vimrc:

                    au BufWinLeave *.c,*.cpp,*.h mkview
                    au BufWinEnter *.c,*.cpp,*.h silent loadview

            I'm not sure if you are editing c/++ or some other language. Obviously you can update these auto-commands to handle the file types you are editing. The trick here is that vim will save and restore a bunch of settings like folds position in file, etc when you close a window and restore these settings when you come back to the file... Even across vim invocations!!!


            Bindu Wavell
            Software Architect
            eConvergent, Inc
            303.827.2140

            ******************************************************************************
            This email message and any attachments are solely for the use of the intended recipient(s) and may contain confidential and/or privileged information.  Any unauthorized use, review, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message and attachments.
            ******************************************************************************
          Your message has been successfully submitted and would be delivered to recipients shortly.