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

Re: Highlighted text as text object

Expand Messages
  • Benji Fisher
    ... Without a mapping, it is easy to select it in Visual mode with v//e ... That solves the problem of setting the /e flag, although it fails on the last
    Message 1 of 5 , Feb 27, 2006
    • 0 Attachment
      On Mon, Feb 27, 2006 at 03:35:53PM -0500, Halim, Salman wrote:
      > Personally, I'm in favour of more text objects. Until (and unless) this
      > functionality gets implemented, you might have to map cih and dih;
      > assuming you're already at the start of the match, you could do
      > something like:
      >
      > nmap dih d/<c-r>//e<cr>
      > nmap cih c/<c-r>//e<cr>
      >
      > Of course, this will only work once as the /e flag will then get stored
      > and subsequent n/N commands will take you to the end of the match, not
      > the beginning, preventing you from simply hitting . to repeat the
      > behaviour.
      >
      > Salman.

      Without a mapping, it is easy to select it in Visual mode with

      v//e<CR>

      If you want a mapping, try "vih" with this one:

      :vmap ih //e<CR><Esc>//<CR>gv

      That solves the problem of setting the /e flag, although it fails on the
      last match if you have set 'nowrapscan' .

      HTH --Benji Fisher
    Your message has been successfully submitted and would be delivered to recipients shortly.