| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| as stated: VIM: How to go to the next line that doesn't contain a pattern? E.g., in the list below foo dog foo cat bar food nuff said and more to come Starting from the top, I want to go to the first line that doesn't contain "foo". |
|
#2
| |||
| |||
| Kenny McCormack wrote: > as stated: VIM: How to go to the next line that doesn't contain a pattern? > > E.g., in the list below > > foo dog > foo cat > bar food > nuff said > and more to come > > Starting from the top, I want to go to the first line that doesn't > contain "foo". > ^\%(\%(foo\)\@!.\)*$ Canoe |
|
#3
| |||
| |||
| In article <Ke3lk.41$ZV1.24@trnddc07>, canoe <canoe@nospam.com> wrote: >Kenny McCormack wrote: >> as stated: VIM: How to go to the next line that doesn't contain a pattern? >> >> E.g., in the list below >> >> foo dog >> foo cat >> bar food >> nuff said >> and more to come >> >> Starting from the top, I want to go to the first line that doesn't >> contain "foo". >> > >^\%(\%(foo\)\@!.\)*$ > >Canoe 1) Surely there is an easier way - more direct. I'm pretty sure I used to know how to do this: something like !/foo/ 2) I don't want to have to re-engineer (reverse) the reg exp. Obviously, foo isn't the actual case. |
|
#4
| |||
| |||
| Kenny McCormack wrote: > In article <Ke3lk.41$ZV1.24@trnddc07>, canoe <canoe@nospam.com> wrote: >> Kenny McCormack wrote: >>> as stated: VIM: How to go to the next line that doesn't contain a pattern? >>> >>> E.g., in the list below >>> >>> foo dog >>> foo cat >>> bar food >>> nuff said >>> and more to come >>> >>> Starting from the top, I want to go to the first line that doesn't >>> contain "foo". >>> >> ^\%(\%(foo\)\@!.\)*$ >> >> Canoe > > 1) Surely there is an easier way - more direct. I'm pretty sure I used > to know how to do this: something like !/foo/ > 2) I don't want to have to re-engineer (reverse) the reg exp. > Obviously, foo isn't the actual case. > There's LogiPat, a logical pattern handling plugin: http://vim.sourceforge.net/scripts/s...script_id=1290 :LP !"foo" Canoe |
|
#5
| |||
| |||
| In article <9_3lk.60$T91.38@trnddc04>, canoe <canoe@nospam.com> wrote: .... >There's LogiPat, a logical pattern handling plugin: > > http://vim.sourceforge.net/scripts/s...script_id=1290 > >:LP !"foo" > >Canoe That looks interesting. It suggests that the problem isn't as easy as I seem to remember it being (since a plugin was developed to address it). |
|
#6
| |||
| |||
| Kenny McCormack wrote: >That looks interesting. It suggests that the problem isn't as easy as I >seem to remember it being (since a plugin was developed to address it). You are possibly remembering how to list lines not containing foo: :v/foo/p Which can be entered simply as: :v/foo Canoe's advice looks best to me, and should be used to update some tips on the wiki: http://vim.wikia.com/wiki/Match_every_word_except_foo John |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.