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

Re: Buffer swapping

Expand Messages
  • Piet Delport
    ... Do you mean: nmap :bn nmap :bp or did you have something more subtle in mind? -- Piet Delport Today s subliminal thought is:
    Message 1 of 7 , Nov 1, 2002
    • 0 Attachment
      On Fri, 01 Nov 2002 at 23:15:51 +1100, Russell wrote:
      >
      > Is there a one-button method of switching between buffers?
      > How could i map F6 to switch to the next buffer and display it, and F7
      > to switch to the previous buffer and display it?

      Do you mean:

      nmap <F5> :bn<CR>
      nmap <F6> :bp<CR>

      or did you have something more subtle in mind?

      --
      Piet Delport
      Today's subliminal thought is:
    • Russell
      ... Hi, I was just wondering if there was a standard way for vim users to quickly switch between buffers without needing to add that capability. When i ve had
      Message 2 of 7 , Nov 2, 2002
      • 0 Attachment
        Piet Delport wrote:
        >
        > On Fri, 01 Nov 2002 at 23:15:51 +1100, Russell wrote:
        > >
        > > Is there a one-button method of switching between buffers?
        > > How could i map F6 to switch to the next buffer and display it, and F7
        > > to switch to the previous buffer and display it?
        >
        > Do you mean:
        >
        > nmap <F5> :bn<CR>
        > nmap <F6> :bp<CR>
        >
        > or did you have something more subtle in mind?

        Hi,
        I was just wondering if there was a standard way for
        vim users to quickly switch between buffers without
        needing to add that capability.

        When i've had 20+ buffers loaded (a whole C project), i've
        found it more efficient to use the mouse menu to pick the
        next buffer to edit instead of doing like :ls :b15.

        In an IDE in windows, it's all very easy to pick the
        file you want to edit just by clicking the mouse on
        a file in a tree display in a file-selection project
        panel down the left side of the screen. How can gvim
        users get a permanently displayed panel of buffers
        down the left side of the screen?
      • Dan Sharp
        ... Take a look at the BufExplorer.vim script at http://www.vim.org/script.php?script_id=42 It opens a buffer that works quite similarly to the File Explorer
        Message 3 of 7 , Nov 2, 2002
        • 0 Attachment
          >From: Russell <rjshaw@...>
          >
          >In an IDE in windows, it's all very easy to pick the
          >file you want to edit just by clicking the mouse on
          >a file in a tree display in a file-selection project
          >panel down the left side of the screen. How can gvim
          >users get a permanently displayed panel of buffers
          >down the left side of the screen?

          Take a look at the BufExplorer.vim script at
          http://www.vim.org/script.php?script_id=42

          It opens a buffer that works quite similarly to the File Explorer plugin
          that is included with vim. You can open the buffer explorer in its own
          window and click on files in the list to open them in another window.

          Dan Sharp

          _________________________________________________________________
          Choose an Internet access plan right for you -- try MSN!
          http://resourcecenter.msn.com/access/plans/default.asp
        • Russell
          ... That s quite useful. In split mode, is it possible to mouse-click a line in the buffer list, and have that file displayed in the *other* window?
          Message 4 of 7 , Nov 3, 2002
          • 0 Attachment
            Dan Sharp wrote:
            >
            > >From: Russell <rjshaw@...>
            > >
            > >In an IDE in windows, it's all very easy to pick the
            > >file you want to edit just by clicking the mouse on
            > >a file in a tree display in a file-selection project
            > >panel down the left side of the screen. How can gvim
            > >users get a permanently displayed panel of buffers
            > >down the left side of the screen?
            >
            > Take a look at the BufExplorer.vim script at
            > http://www.vim.org/script.php?script_id=42
            >
            > It opens a buffer that works quite similarly to the File Explorer plugin
            > that is included with vim. You can open the buffer explorer in its own
            > window and click on files in the list to open them in another window.

            That's quite useful. In split mode, is it possible to mouse-click
            a line in the buffer list, and have that file displayed in the
            *other* window?
          • Piet Delport
            ... The various plugins for this have already been mentioned, but you might be interested in knowing that :buffer can also take a filename (or part of a
            Message 5 of 7 , Nov 3, 2002
            • 0 Attachment
              On Sun, 03 Nov 2002 at 02:06:16 +1100, Russell wrote:
              > Piet Delport wrote:
              >> On Fri, 01 Nov 2002 at 23:15:51 +1100, Russell wrote:
              >>>
              >>> How could i map F6 to switch to the next buffer and display it, and F7
              >>> to switch to the previous buffer and display it?
              >>
              >> nmap <F5> :bn<CR>
              >> nmap <F6> :bp<CR>
              >
              > I was just wondering if there was a standard way for
              > vim users to quickly switch between buffers without
              > needing to add that capability.
              >
              > When i've had 20+ buffers loaded (a whole C project), i've
              > found it more efficient to use the mouse menu to pick the
              > next buffer to edit instead of doing like :ls :b15.

              The various plugins for this have already been mentioned, but you might
              be interested in knowing that :buffer can also take a filename (or part
              of a filename) as argument. So you don't need to use a buffer number if
              you know the name of the file you want.

              Typing :b foo will search the buffer list for the text `foo', and edit
              the matching file. The text can be part of the directory or filename of
              the buffer, and Vim will even do completion of buffer names, similar to
              filename completion. This also works for :sb and other buffer commands
              too, of course.



              --
              Piet Delport
              Today's subliminal thought is:
            • Dan Sharp
              ... I m sure there probably is. I m not sure how to do it by itself, but you may be interested in the WinManager plugin at
              Message 6 of 7 , Nov 3, 2002
              • 0 Attachment
                >From: Russell <rjshaw@...>
                >
                >That's quite useful. In split mode, is it possible to mouse-click
                >a line in the buffer list, and have that file displayed in the
                >*other* window?

                I'm sure there probably is. I'm not sure how to do it by itself, but you
                may be interested in the WinManager plugin at
                http://www.vim.org/script.php?script_id=95 which does precisely that.

                Dan Sharp

                _________________________________________________________________
                Unlimited Internet access -- and 2 months free!� Try MSN.
                http://resourcecenter.msn.com/access/plans/2monthsfree.asp
              Your message has been successfully submitted and would be delivered to recipients shortly.