Tuesday, January 17, 2012

specifying multiple ranges in vim

does anybody know if it is possible to specify multiple ranges in vim for a command execution
for example:
:1,4s/old/new/g - this command will replace old to new in lines 1 to 4 inclusive

however what if i want to execute this command in multiple places say something like

:1,4;10,14;20,24s/old/new/g - i want to do a replacement on lines 1 through 4, 10 through 14, and 20 through 24

does anybody know if it is possible in vim?

any help is appreciated,
thanks.

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