Saturday, July 30, 2011

substitute on odd lines only

I want to perform a substitute command on odd lines only.
Is there some some "range" for this like sed 1~2 in vim?
Else do you know a better solution than
:%!sed '1~2s/pattern/replace/'
?
(not so complicated after all)

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

No comments: