Pressing `%` will also jump to the matching HTML tag

I’ve used % for some time now in vim, but I only just today learned that it not only jumps to a matching bracket or parenthesis, but also a matching HTML tag! Unfortunately this doesn’t seem to work with vscode-vim but it does work with vscode-neovim. You could also accomplish this by assigning a hotkey to the “Go to matching pair” Emmet command.

Split lines in Vim

I’ve long wanted a command that was the opposite of J (join lines), and I finally took the time to see if it’s possible. Turns out there a few solutions. The simplest way if you want to split on a whitespace character is to just type r enter. I can’t believe I never thought of that before. You can also install the vim-split-line plugin, which adds the :SplitLine command. This command will split the current line at the cursor position. ...

b is an Alias for Parenthesis in Vim

I just discovered that b and B are aliases for the () and {} text objects respectively. This is a nice little builtin improvement since I frequently find myself selecting or changing withing parenthesis and cib is nicer to type than ci(. I only wished I’d discovered this years ago!

Git rebase.abbreviateCommands

This is probably a very niche use case, but I learned today that you can abbreviate commands that git populates in the todo list during an interactive rebase. So it’ll look like this: p deadbee The oneline of the commit p fa1afe1 The oneline of the next commit You can enable this with git config --global rebase.abbreviateCommands true. To be clear, you can always use the abbreviated commands, but since I use Vim to edit the list, it makes it slightly more convenient to edit the commands. ...

Quit vim with :x

People like to joke that vim is impossible to exit, but I just discovered that there are actually several different ways to quit and :x is my new favorite. The :x command will save and quit but it differs from :wq in that it will only write the file to disc if there were any changes so the modified date of the file won’t get updated unnecessarily. This seems like the preferred behavior most of the time. That coupled with the fact that it’s slightly faster to type has made it my new default way to exit vim. ...

Open a URL in vim with `gx`

Pressing gx while over a URL in vim will open that url. Confirmed it also works in vscode-vim.

Format a paragraph

In vim you can format a paragraph of prose text with gq. This basically will hard-wrap the lines to the configured textwidth for the filetype. I use this all the time when writing git commit messages so the body of the message has the recommended max line length of 72.

Bram Moolenaar has passed

I just found out about the passing of Bram Moolenaar, the core maintainer of Vim for the last 30 years 😞 I like what a commenter posted: Vim has soul. It is that chisel you inherited from your grandpa that you keep using. It fits well in your grip and is comfortable, even though it lacks the soft rubber that the new ones in the store have. It’s a tool with its own history. ...