vim-hacks
latest
archive
categories
about
◐
light
☰
latest
archive
categories
about
◐
light
category 05 / 10
Global command
The one command that runs another command on every matching line.
003
entries
003 min
avg read
all
003
global
003
join
001
blank-lines
001
ranges
001
move
001
reverse
001
lines
001
filter
001
inverse
001
delete
001
039
Squeeze every run of blank lines down to a single blank line
:g/^$/,/./-j
2026.11.30
004 min
026
Reverse the order of every line in the file
:g/^/m0
2026.10.12
003 min
018
Keep only the lines that match and delete the rest
:v/pattern/d
2026.09.16
003 min
showing 003 of 003
-- NORMAL --
vim-hacks.com
categories/global-command.html
utf-8
1,1
All