regular expression blindness

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

regular expression blindness

meino.cramer
Hi,

sorry, this may be a very stupdi question (tm) but...

I try to find an error-line in a very longis tar output log
(and do later some editing with it). By the way...I am doing this
on Linux...:)

Except for the error reporting line all lines start with '\.\/' but
I dont know it contents. Searching for 'error' gives me be far to many
hits from regular files (listed in the log).

So...I am trying to find any line NOT starting with '\.\/' (dot
slash).

I can invert a singe character with [^c] (meaning anything not 'c')
and I can NOT find alternatives...

But how can I NOT find a sepecific sequence of characters at the
beginning of a line?

Thank you ver much for any help!

Best regards and have a nice weekend!
mcc




--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Matteo Cavalleri

> But how can I NOT find a sepecific sequence of characters at the
> beginning of a line?

since it's just the first 2 characters, i'd try with

/^[^\.][^\/]

but if you need to delete all the other lines you should also be able to do

:v/\.\//d

(see :help :v)

anyway a little search on google should give you more answers

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Lech Lorens
In reply to this post by meino.cramer
On Saturday, February 1, 2014 12:41:34 PM UTC+1, [hidden email] wrote:
>
> Except for the error reporting line all lines start with '\.\/' but
> [...]
>
> I can invert a singe character with [^c] (meaning anything not 'c')
> and I can NOT find alternatives...
>
> But how can I NOT find a sepecific sequence of characters at the
> beginning of a line?

There's \@!. A very-magic regexp version will look as follows:
\v^(\.\/)@!..

HTH,
Lech

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Tim Chase
In reply to this post by meino.cramer
On 2014-02-01 12:41, [hidden email] wrote:

> Hi,
>
> sorry, this may be a very stupdi question (tm) but...
>
> I try to find an error-line in a very longis tar output log
> (and do later some editing with it). By the way...I am doing this
> on Linux...:)
>
> Except for the error reporting line all lines start with '\.\/' but
> I dont know it contents. Searching for 'error' gives me be far to
> many hits from regular files (listed in the log).
>
> So...I am trying to find any line NOT starting with '\.\/' (dot
> slash).
>
> I can invert a singe character with [^c] (meaning anything not 'c')
> and I can NOT find alternatives...
>
> But how can I NOT find a sepecific sequence of characters at the
> beginning of a line?

You have a couple options that occur to me:

1) if you can delete the content, just use :v instead of :g making it

  :v/^\.\//d

2) if you just want to search, you can use the more complex pattern

  /^\(\.\/\)\@!

which asserts that the stuff in the \(...\) is not fount ("\@!") at
the beginning of the line.

-tim



--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Erik Christiansen
On 01.02.14 08:23, Tim Chase wrote:
> 2) if you just want to search, you can use the more complex pattern
>
>   /^\(\.\/\)\@!

Yebbut, that's nearly 50% backslashes, so hard to read through the
picket fence. In less obsolete syntax it is:

   /\v^(\.\/)@!

I.e. only the literalised magic chars need be escaped. The picket fence
of backslashes which do nothing useful is completely gone. :-)

Now if Vim had a config option to preset "\v" (posix ERE), then we'd be
in the 21st century at last.

Erik

--
... and to avoid the tedious repetition of these woordes 'is equal to'        
I will sett, as I doe often in woorke use, a paire of parralelles or          
twin lines of one length, thus = bicause no 2 things can be moare equal.      
- Robert Recorde, writing in 1557 (quoted by Tubal Cain, in ME No. 4042)

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Marcin Szamotulski
On 19:17 Sun 02 Feb     , Erik Christiansen wrote:

> On 01.02.14 08:23, Tim Chase wrote:
> > 2) if you just want to search, you can use the more complex pattern
> >
> >   /^\(\.\/\)\@!
>
> Yebbut, that's nearly 50% backslashes, so hard to read through the
> picket fence. In less obsolete syntax it is:
>
>    /\v^(\.\/)@!
>
> I.e. only the literalised magic chars need be escaped. The picket fence
> of backslashes which do nothing useful is completely gone. :-)
>
> Now if Vim had a config option to preset "\v" (posix ERE), then we'd be
> in the 21st century at last.
>
> Erik

Since we are in 21st century ;), I just wrote a small plugin for that:
http://www.vim.org/scripts/script.php?script_id=4849

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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Tim Chase
In reply to this post by Erik Christiansen
On 2014-02-02 19:17, Erik Christiansen wrote:

> On 01.02.14 08:23, Tim Chase wrote:
> > 2) if you just want to search, you can use the more complex
> > pattern
> >
> >   /^\(\.\/\)\@!  
>
> Yebbut, that's nearly 50% backslashes, so hard to read through the
> picket fence. In less obsolete syntax it is:
>
>    /\v^(\.\/)@!

50%...that's only a 9-10% reduction in total length ;-)
(granted, it will amortize as the number of escaped characters grows
longer; and depending on the way of searching, the "/" doesn't always
need to be escaped)

> Now if Vim had a config option to preset "\v" (posix ERE), then
> we'd be in the 21st century at last.

That breaks enough plugins and existing muscle memory that I'm fairly
certain it will never happen.  It's muscle memory that has me stuck.
I still get stung going to other RE engines (sed, awk, and
JavaScript/PCREs) as I have to translate from my day-to-day Vim
syntax to the syntax(es) that others find natural.

-tim




--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Erik Christiansen
In reply to this post by Marcin Szamotulski
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

--
Pessimist:  The glass is half empty.
Optimist:   The glass is half full.
Engineer:   The glass is twice as big as it needs to be.
                                                - Read on avr-chat ML
Pragmatist: Who cares, so long as there's more in the bottle.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Erik Christiansen
In reply to this post by Tim Chase
On 02.02.14 08:25, Tim Chase wrote:
> On 2014-02-02 19:17, 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.
>
> That breaks enough plugins and existing muscle memory that I'm fairly
> certain it will never happen.

Marcin's nifty strategy - injecting it on user entry only - seems to
dodge that bullet brilliantly, AFAICT.

> It's muscle memory that has me stuck.
> I still get stung going to other RE engines (sed, awk, and
> JavaScript/PCREs) as I have to translate from my day-to-day Vim
> syntax to the syntax(es) that others find natural.

That painful problem can also be dodged - I use egrep | grep -e,
sed -e, awk, lex, and vim with \v, so that one regex syntax works
for all. OK, vim has some extensions, as does lex, but the 95% used every
day is the same. Now muscle memory works for me, rather than against.

The backslash storm in BREs arises because they don't know whether
they're regexes or plain text - so many characters need to be escaped to
become magic. EREs eliminate a lot of backslashes - and confusion, since:

Anything that can be magic already is, and must be escaped to be literal.

One rule - not much confusion. Simple enough for me to handle. :-)

Erik

--
Habit is habit, and not to be flung out of the window by any man, but
coaxed down-stairs a step at a time.                
                          - Mark Twain, "Pudd'nhead Wilson's Calendar

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Marcin Szamotulski
In reply to this post by Erik Christiansen
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

meino.cramer
Marcin Szamotulski <[hidden email]> [14-02-03 18:24]:

> 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 [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>

Hi,

...it started with a simple question of a regex blind...and now THIS!
GREAT!

Thank you very much!

best regard,
mcc

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Marcin Szamotulski
On 19:39 Mon 03 Feb     , [hidden email] wrote:

> Marcin Szamotulski <[hidden email]> [14-02-03 18:24]:
> > 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 [hidden email].
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
>
> Hi,
>
> ...it started with a simple question of a regex blind...and now THIS!
> GREAT!
>
> Thank you very much!
>
> best regard,
> mcc

Well, sorry for hijacking the thread ;)

Best regards,
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

meino.cramer
Marcin Szamotulski <[hidden email]> [14-02-03 20:04]:

> On 19:39 Mon 03 Feb     , [hidden email] wrote:
> > Marcin Szamotulski <[hidden email]> [14-02-03 18:24]:
> > > 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 [hidden email].
> > > For more options, visit https://groups.google.com/groups/opt_out.
> > >
> >
> > Hi,
> >
> > ...it started with a simple question of a regex blind...and now THIS!
> > GREAT!
> >
> > Thank you very much!
> >
> > best regard,
> > mcc
>
> Well, sorry for hijacking the thread ;)
>
> Best regards,
> Marcin
>

Hi Marcin,

nononono.....sorry my joke goes the wrong way...I meant:
THANK YOU VERY MUCH FOR HIJACKING THIS THREAD AND OF COURSE FOR THE
PLUGINS!

With this statement I officially allow

      Marcin Szamotulski

to intercept and hijack any thread of mine on the vim mailinglist
for the purpose of enlightment, fun, education and plugins (of course).
w!

Best reagards,
mcc
blinded by the regex




Marcin Szamotulski <[hidden email]> [14-02-03 20:04]:

> On 19:39 Mon 03 Feb     , [hidden email] wrote:
> > Marcin Szamotulski <[hidden email]> [14-02-03 18:24]:
> > > 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

        Marcin Szamotulski <[hidden email]> [14-02-03 20:04]:

> On 19:39 Mon 03 Feb     , [hidden email] wrote:
> > Marcin Szamotulski <[hidden email]> [14-02-03 18:24]:
> > > 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


> --
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.
>

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Charles Campbell
In reply to this post by meino.cramer
[hidden email] wrote:

> Hi,
>
> sorry, this may be a very stupdi question (tm) but...
>
> I try to find an error-line in a very longis tar output log
> (and do later some editing with it). By the way...I am doing this
> on Linux...:)
>
> Except for the error reporting line all lines start with '\.\/' but
> I dont know it contents. Searching for 'error' gives me be far to many
> hits from regular files (listed in the log).
>
> So...I am trying to find any line NOT starting with '\.\/' (dot
> slash).
>
> I can invert a singe character with [^c] (meaning anything not 'c')
> and I can NOT find alternatives...
>
> But how can I NOT find a sepecific sequence of characters at the
> beginning of a line?
>
You could try my LogiPat plugin.  In this case, using it would be:

:LP !"\.\/" && "error"

ie. NOT ./ and must have "error".

You can get LogiPat from my website:
http://www.drchip.org/astronaut/vim/index.html#LOGIPAT.

Regards,
Charles Campbell

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: regular expression blindness

Marcin Szamotulski
In reply to this post by meino.cramer
> > 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 [hidden email].
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
>
> Hi,
>
> ...it started with a simple question of a regex blind...and now THIS!
> GREAT!
>
> Thank you very much!
>
> best regard,
> mcc


I've been working on this plugin, and its better version is on github
which supports <c-f> as well (thanks to Ben Fritz who helped me here on
vim_use) and a few other commands: substitute, global, vimgrep, lvimgrep, and also
the +/ argument for edit and friends (also can escape backslashes what
I always forgot to do :) ).  Here is the link:
https://github.com/coot/EnchantedVim
it has a dependency now:
https://www.github/coot/CRDispatcher

If you use one of the others of myplugins: System or CmdAlias you also
need to update them from their github repos.

Best regards,
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.