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

Re: positioning in a vim file from another window

Expand Messages
  • Dan Sharp
    ... Yes, it can. The immediate example is quickfix mode, where the quickfix windows contains compiler output, and clicking / hitting enter on one of the lines
    Message 1 of 5 , Apr 2, 2003
    • 0 Attachment
      Eric Winger wrote:
      > My coworker & I are debating whether vim can do this emacs thing. He thinks
      > vim can, I'm not convinced.
      >
      > In general, does vim have the capability to reposition another buffer and move
      > to that position in the other buffer? (Or is window the correct term)

      Yes, it can. The immediate example is quickfix mode, where the quickfix
      windows contains compiler output, and clicking / hitting enter on one of
      the lines will jump you to the corresponding file and line (and column,
      if that much info is available).

      See :he quickfix

      > Here's two examples from emacs I'm thinking of:
      > * I can open a buffer list in emacs navigate to a line in the buffer list,
      > press Enter or o and the alternate buffer will open and put me in that
      > buffer.

      Look on www.vim.org for scripts like BufExplorer.

      > * I can do a 'grep' or Mx list-matching-lines and get a nice little buffer of
      > all matching lines in the current buffer. From which I can press Enter and be
      > taken to that line in the other buffer.

      The :grep command does just that. Run :grep <pattern> to find the
      matching lines. The command :cwindow will open the quickfix window to
      show the list of matches, and clicking / hitting enter on a line will
      open the matching file in a new window and jump you to the matching line.

      See :he :grep

      Dan Sharp
    • Pavel Tavoda
      Generally I don t know, however for grep like positioning and error positioning here is some support; ... Pavel
      Message 2 of 5 , Apr 2, 2003
      • 0 Attachment
        Generally I don't know, however for grep like positioning
        and error positioning here is some support;
        :help grep
        :help quickfix
        :help colder

        Pavel

        Eric Winger wrote:

        >My coworker & I are debating whether vim can do this emacs thing. He thinks
        >vim can, I'm not convinced.
        >
        >In general, does vim have the capability to reposition another buffer and move
        >to that position in the other buffer? (Or is window the correct term)
        >
        >Here's two examples from emacs I'm thinking of:
        >* I can open a buffer list in emacs navigate to a line in the buffer list,
        >press Enter or o and the alternate buffer will open and put me in that
        >buffer.
        >
        >* I can do a 'grep' or Mx list-matching-lines and get a nice little buffer of
        >all matching lines in the current buffer. From which I can press Enter and be
        >taken to that line in the other buffer.
        >
        >Thanks,
        >
        >eric
        >
        >
      • Eric Winger
        Excellent! The grep thing works neatly. Now can one do the equivalent of opening a directory in emacs and allow quick selections in the quickfix window? I
        Message 3 of 5 , Apr 2, 2003
        • 0 Attachment
          Excellent! The grep thing works neatly.

          Now can one do the equivalent of opening a directory in emacs and allow quick
          selections in the quickfix window?

          I tried loading up the minibuffer. But it doesn't seem to work. I tried
          putting the .vim in my vim61/ftplugins directory. It didn't open
          automagically. I then tried :source mini... but that didn't seem to open
          anything either.

          But I'm not sure that this will do what I was talking about. Where, in effect,
          I can dump the output from a ls to the quickfix window and then scroll & open
          new buffers from that.

          Any ideas?

          thx

          eric


          On Wednesday 02 April 2003 09:43 am, Dan Sharp wrote:
          > Eric Winger wrote:
          > > My coworker & I are debating whether vim can do this emacs thing. He
          > > thinks vim can, I'm not convinced.
          > >
          > > In general, does vim have the capability to reposition another buffer and
          > > move to that position in the other buffer? (Or is window the correct
          > > term)
          >
          > Yes, it can. The immediate example is quickfix mode, where the quickfix
          > windows contains compiler output, and clicking / hitting enter on one of
          > the lines will jump you to the corresponding file and line (and column,
          > if that much info is available).
          >
          > See :he quickfix
          >
          > > Here's two examples from emacs I'm thinking of:
          > > * I can open a buffer list in emacs navigate to a line in the buffer
          > > list, press Enter or o and the alternate buffer will open and put me in
          > > that buffer.
          >
          > Look on www.vim.org for scripts like BufExplorer.

          >
          > > * I can do a 'grep' or Mx list-matching-lines and get a nice little
          > > buffer of all matching lines in the current buffer. From which I can
          > > press Enter and be taken to that line in the other buffer.
          >
          > The :grep command does just that. Run :grep <pattern> to find the
          > matching lines. The command :cwindow will open the quickfix window to
          > show the list of matches, and clicking / hitting enter on a line will
          > open the matching file in a new window and jump you to the matching line.
          >
          > See :he :grep
          >
          > Dan Sharp
        • Dan Sharp
          ... It doesn t use the quickfix window, but just doing ... or ... will bring up the file explorer. Look at ... for help on using it, including keeping it open
          Message 4 of 5 , Apr 2, 2003
          • 0 Attachment
            Eric Winger wrote:
            > Excellent! The grep thing works neatly.
            >
            > Now can one do the equivalent of opening a directory in emacs and allow quick
            > selections in the quickfix window?

            It doesn't use the quickfix window, but just doing
            :e .
            or
            :Explore
            will bring up the file explorer. Look at
            :he file-explorer
            for help on using it, including keeping it open while opening files into
            new windows.

            > I tried loading up the minibuffer. But it doesn't seem to work. I tried
            > putting the .vim in my vim61/ftplugins directory. It didn't open
            > automagically. I then tried :source mini... but that didn't seem to open
            > anything either.
            >
            > But I'm not sure that this will do what I was talking about. Where, in effect,
            > I can dump the output from a ls to the quickfix window and then scroll & open
            > new buffers from that.
            >
            > Any ideas?

            It looks like you got minibufexplorer, but you want just plain
            BufExplorer by Jeff Lanzarotta (or Hari Krishna Dara's SelectBuf
            script). They open a buffer with a list of the currently available
            buffers, and clicking on an item in the list will jump you to that buffer.

            In fact, to see them all working together, you may want to look at the
            WinManager plugin. It sets up an IDE-like environment with the file
            explorer and buffer explorer always open on the left side. See the
            screenshot at
            http://robotics.eecs.berkeley.edu/~srinath/vim/snapshot2.JPG for an example.

            Dan Sharp
          Your message has been successfully submitted and would be delivered to recipients shortly.