Monday, February 3, 2014

Re: regular expression blindness

On 20:09 Mon 03 Feb , Erik Christiansen wrote:
> On 02.02.14 13:48, Marcin Szamotulski wrote:
> > On 19:17 Sun 02 Feb , Erik Christiansen wrote:
> > > Now if Vim had a config option to preset "\v" (posix ERE), then we'd be
> > > in the 21st century at last.
>
> > Since we are in 21st century ;), I just wrote a small plugin for that:
> > http://www.vim.org/scripts/script.php?script_id=4849
>
> Ooooh! Downloaded, and voted as "Life changing".
>
> Works brilliantly, straight out of the box.
>
> (Note: If the first match is in a closed fold, it is not opened, so I
> just hit <right-arrow>. Subsequent matches do open the fold. )
>
> Many Many Thanks, Marcin!
>
> Erik

Thanks!

I have found this trick earlier using :! in vim. You can check to other
nifty plugins using the same <C-\>e cmap trick:
1) system.vim: http://www.vim.org/scripts/script.php?script_id=4224
for :!ls and :! ls (the second one will run :echo system("ls") and
there is a difference with using system() or :! in vim, though in
gvim they work more or less the same)
2) cmd_alias.vim: http://www.vim.org/scripts/script.php?script_id=4250
for making aliases: with this plugin you can define lower case user
commands, what is forbidden by a direct usage of :command (see :help
command)

I am happy you like it! I like it too.

Like Tim, I also have a strong vim muscle memory, but let's face it.
For some time I've been already thinking that \(..\|..\) is to much
pain.

Another solution is to define a map:
nm / /\v
and the advantage is that you can delete \v with a single <c-u>, with my
plugin you have to explicitly type \m.

Cheers,
Marcin

--
--
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