vi/vim tricks

vi or vim is a powerful text editor that comes installed by default in most Linux and Unix systems. You’ll find many tutorials online that’s get you started quickly. There’s also the command vimtutor that contains enough information for most day to day editing needs.

This blog post is for my reference and contains commands I found useful for specific tasks. These commands are relevant for Linux (all falvours) and MacOS terminal.

Setup vi/vim configuration
Delete blank lines
Remove duplicate lines
Join the line above after current line
How to join all lines together which match pattern