Split lines in Vim

I鈥檝e long wanted a command that was the opposite of J (join lines), and I finally took the time to see if it鈥檚 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鈥檛 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. ...

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鈥檒l 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鈥檛 get updated unnecessarily. This seems like the preferred behavior most of the time. That coupled with the fact that it鈥檚 slightly faster to type has made it my new default way to exit vim. ...