How do I delete all blank lines in a file?
:g/^$/d
The :g/^$/d command deletes every blank line in the file using Vim's powerful global command.
:g/^$/d
The :g/^$/d command deletes every blank line in the file using Vim's powerful global command.
:cfdo %s/old/new/g | update
The :cfdo %s/old/new/g update command performs a search and replace across every file in the quickfix list and saves each one.
cgn
The cgn command combines the change operator with the gn motion to change the next occurrence of your last search pattern.
:%s/old/new/g
The :%s/old/new/g command replaces all occurrences of old with new across every line in the file.
:g/pattern/d
The :g/pattern/d command deletes every line in the file that matches the given pattern.