I’m a long-time vi(m) user and I have question.
Can I remove lines that contain a pattern but not another pattern?
For example,

Line 1 : rabbit
Line 2 : arch sparc
Line 3 : arch arm
Line 4 : tiger
I want to remove lines containing arch but not containing sparc.
So Here I want to remove only line 3 leaving lines 1, 3 and 4 intact.

I can remove lines containg ‘arch’ by
:g/arch/d
I can remove lines not containing ‘sparc’ by
:g!/sparc/d
How do I combine those two?
I tried
:g/arch/&!/sparc/d  or :g/arch&!sparc/d
But of course it doesn’t work. (with escape before ! also)
Is there a way to remove only line 3? I looked it up in the manual but in vain..
Thank you!

-------------------------------------------------------------------------

김찬, 책임연구원

한국전자통신연구원 융합기술연구부문 멀티미디어프로세서연구실

Chan Kim, Principal Researcher

ETRI (Electronics and Telecommnications Research Institute)

O)+82-42-860-5773  C) +82-10-3418-9152

E)[email protected]       web) 
http://chankim.dothome.co.kr<http://chankim.dothome.co.kr/>



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

Reply via email to