Dev In The Mountain Header
A Developer In The mountains having fun

Global VIM command

Syntax: :g/pattern/command

Common use caes:

Delete a line containing a pattern

:g/pattern/d

reverse selection

this will act on all lines not matching the pattern

g!/pattern/command

work on a range of lines based on 2 patterns

:g/pattern1/,/pattern2/command

Multiplel commands

use the | operator to execute multiple commands

More places to find me
Mental Health
follow me on Mastodon