Does trailing whitespace make your blood boil? Although there are plenty of ways to automatically trim trailing whitespace when committing, or even to hide whitespace in diffs, you can easily trim whitespace in Vim with a simple plugin.Continue reading »
Ever open your /etc/hosts file in Vim, make a bunch of edits, only to
get that dreaded read only error? There a few easy ways to sudo write a
privileged file in Vim.
Keeping lists alphabetized is important for organized, maintainable code. Fortunately, Vim has a number of ways to sort lines.Continue reading »
When I wind up with code that is not well formatted, the
= command comes in
handy. This command runs applies a formatter to your motion or visual
selection. So two handy sequences of commands I keep at hand are
=%. The later takes advantage of the
matchit plugin which
% to match a broad array of open close blocks like those found in the
Ruby programming language.
When pasting into Vim from an external source, for example when using ⌘-V in a terminal on macOS, you’ll find that pasted text loses its indentation.Continue reading »