Sorting Text
Keeping lists alphabetized is important for organized, maintainable code. Fortunately, Vim has a number of ways to sort lines.
Continue reading »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 gg=G
and
=%
. The later takes advantage of the
matchit plugin which
enhances %
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 »At this point in the technology age, nothing is more powerful and necessary to anyone editing text than being able to copy and paste. Here’s how to do it Vim style:
Continue reading »If you’ve ever needed to jump quickly to the next commented line of code,
there’s a trick for that. You’ll need to add a new commands to Vim, but that’s
as easy as adding a few lines to your .vimrc file. The following maps ]c
to
jump to the next commented line of code and [c
to the previous.