« Back to Index

Vim filtering with global command, sorting and then filtering out duplicate lines for unique results

View original Gist on GitHub

vim filtering.viml

" Store data we're interested in, inside a capture group and print on separate line
:%s/\vGET (\/.+) H/\r\r\1\r\r/

" Delete any lines that don't start with a forward slash (leaving our capture group output)
:g!/^\//d

" Sort the results and then filter out all duplicates so we have unique results
:sort u