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

Re: Searching for selected text

Expand Messages
  • Yakov Lerner
    ... Do Ctrl-K/ Ctrl-K? do something in visual mode ? Yakov
    Message 1 of 5 , Oct 1, 2006
      On 9/30/06, Bram Moolenaar <Bram@...> wrote:
      >
      > Sometimes people ask me for a command to search for the text that is
      > currently visually selected. You could add a mapping for the '/' key,
      > but then you lose the possibility to extend the visual area by
      > searching for a pattern.
      >
      > Since we might need more commands in Visual mode later, and we only have
      > a few keys left to be used, we need to use two key combinations for
      > new commands in Visual mode.
      >
      > I think we can start using the '&' key. Currently it doesn't do
      > anything. For now we could add the commands:
      >
      > &/ search for the Visually selected text forward
      > &? same, backward

      Do Ctrl-K/ Ctrl-K? do something in visual mode ?

      Yakov
    • Bram Moolenaar
      ... & currently only does something in Normal mode, not in Visual mode. -- BEDEVERE: And what do you burn, apart from witches? FOURTH VILLAGER: ...
      Message 2 of 5 , Oct 1, 2006
        Tony Mechelynck wrote:

        > Bram Moolenaar wrote:
        > > Sometimes people ask me for a command to search for the text that is
        > > currently visually selected. You could add a mapping for the '/' key,
        > > but then you lose the possibility to extend the visual area by
        > > searching for a pattern.
        > >
        > > Since we might need more commands in Visual mode later, and we only have
        > > a few keys left to be used, we need to use two key combinations for
        > > new commands in Visual mode.
        > >
        > > I think we can start using the '&' key. Currently it doesn't do
        > > anything. For now we could add the commands:
        > >
        > > &/ search for the Visually selected text forward
        > > &? same, backward
        > >
        > > Is there a good alternative?
        > >
        >
        > & does do something, but maybe we can do without that, since ":s//~/"
        > does the same (repeat last substitute without the flags) -- it needs
        > six keystrokes instead of one though.

        "&" currently only does something in Normal mode, not in Visual mode.

        --
        BEDEVERE: And what do you burn, apart from witches?
        FOURTH VILLAGER: ... Wood?
        BEDEVERE: So why do witches burn?
        SECOND VILLAGER: (pianissimo) ... Because they're made of wood...?
        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
      • Bram Moolenaar
        ... No, but CTRL-K is also unused in Normal mode. Thus it s better used for something that works both in Visual and Normal mode. -- Back off man, I m a
        Message 3 of 5 , Oct 1, 2006
          Yakov Lerner wrote:

          > On 9/30/06, Bram Moolenaar <Bram@...> wrote:
          > >
          > > Sometimes people ask me for a command to search for the text that is
          > > currently visually selected. You could add a mapping for the '/' key,
          > > but then you lose the possibility to extend the visual area by
          > > searching for a pattern.
          > >
          > > Since we might need more commands in Visual mode later, and we only have
          > > a few keys left to be used, we need to use two key combinations for
          > > new commands in Visual mode.
          > >
          > > I think we can start using the '&' key. Currently it doesn't do
          > > anything. For now we could add the commands:
          > >
          > > &/ search for the Visually selected text forward
          > > &? same, backward
          >
          > Do Ctrl-K/ Ctrl-K? do something in visual mode ?

          No, but CTRL-K is also unused in Normal mode. Thus it's better used for
          something that works both in Visual and Normal mode.

          --
          Back off man, I'm a scientist.
          -- Peter, Ghostbusters

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ download, build and distribute -- http://www.A-A-P.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
        • Charles E Campbell Jr
          ... Hmm -- g/ sounds a lot like vis.vim s :S command for searching a visual block for a pattern. It works with V, v, and ctrl-v type visual blocks. Regards,
          Message 4 of 5 , Oct 2, 2006
            Bram Moolenaar wrote:

            >Matt Mzyzik wrote:
            >
            >
            >
            >>I don't like this one more, but it's a good alternative:
            >> g/
            >> g?
            >>
            >>Also, I feel that one day "&" might do something in visual; at least
            >>visual line mode.
            >>
            >>
            >
            >"g?" is already used for rot13 encoding.
            >
            >"g/" is scheduled to be used to search inside the selected area
            >
            >
            >
            Hmm -- g/ sounds a lot like vis.vim's :S command for searching a visual
            block for
            a pattern. It works with V, v, and ctrl-v type visual blocks.

            Regards,
            Chip Campbell
          Your message has been successfully submitted and would be delivered to recipients shortly.