December 15, 2010

vim global command

http://www.networkcomputing.com/unixworld/tutorial/009/009.part3.html

syntax: g/stuff-to-search/[range]EX command

example:

global /^/ + delete
:g/blah/d  , this deletes all lines containging 'blah'
:g/blah/ ,+ delete , this deletes all lines and next lines that containing 'blah'


See more at http://vimdoc.sourceforge.net/htmldoc/cmdline.html#Command-line

No comments:

Post a Comment