vimtricks.wiki Concise Vim tricks, one at a time.

How do you record a macro to extract URLs from a file?

Answer

qa/https\?:\/\/\nyiW:put\nq

Explanation

Record a macro that searches for URLs, yanks the URL, and puts it at the end of the file. Collects all URLs from the document.

Next

How do you yank a single word into a named register?