Easy find and replace is one of those quality of life improvements that make Vim great. With one quick command, and a little regex, you can replace a pattern across an entire file. Here’s how: Find and replace in the entire file with Vim:%s This is my most-used version of Vim find and replace. :%s […]
Vim
Dedupe a list in Vim
Tldr: use :sort u Surprisingly often, I find myself needing to dedupe a list, usually when digging through logs. There are many ways to dedupe a list, but Vim might just be the fastest one. Take this list of UUIDs I pulled when investigating a recent issue: From a quick look, I can see that […]
How to exit Vim
My preferred method is “:x”. It saves the file only if there is a change to be saved, and then exits. You can also use :wq, :q, or :q!—each one behaves slightly differently.