Wednesday, December 11, 2013

Re: Selecting an IPv4-address?

> On Wednesday, December 11, 2013 6:42:05 AM UTC-6, Paul Isambert
> wrote:
> >
> > let s:patt = '\%(\d\{1,3}\.\)\{3}\d\{1,3}'
> >
>
> [snip]
>
> >
> > onoremap <silent> I :<C-U>call <SID>findIP()<CR>
> >
> >
> >
> > This lets you use "dI", "yI", etc., to delete/yank/etc. the IP
> > address that is
> >
> > the closer to the cursor. This way you don't have to move at the
> > beginning of
> >
> > the address you want, simply as close to it as possible. If there's
> > only one
> >
> > address on the current line, you don't have to move the cursor at
> > all.
> >
>
> It looks like your complicated script just acts on the last search
> match, just like gn does built-in.

Actually it's a bit smarter, in that it also selects the IP address you're on
(with the cursor); the idea is that you probably want to select what your
cursor is closer to. Of course that's just a matter of how the OP really
works, but I thought an alternative solution sometimes helps, and a little
complicated script can be really time-saving.

Plus you simply need "dI", "yI", etc.

Best,
Paul

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment