Vim Registers

If you haven’t done so already, I’d recommend reading the section on “buffers” first. Registers are very similar to buffers they’re just accessed a bit differently. The Yank & Delete Registers (The rolling clipboard) Unnamed Registers When you delete lines of text you are also pushing them onto a stack of 9 numbered registers. Think of it as a rolling clipboard containing the last 9 items. You can put any of the last 9 yanks or deletions into the current text by saying "<num>p where <num> is the number of the register you want to paste. [Read More]

Vim Buffers

You can think of a buffer as a piece of text loaded into memory. They’re especially useful when you need to move text between files using Vim’s built-in copy / paste functionality. You can yank and put between any buffers in the system, but you can’t do it between buffers in other windows. For example. I have two windows open in MacVim (this could be two separate terminal windows too). [Read More]

Vim's Leader Key (wtf is it?)

Sooner or later you’re going to hear mention of the leader key. In vimscript it looks like <Leader>. You can think of it as a trigger, or maybe a shortcut. macOS has the command key (⌘). Vim has the <Leader> key. You type it, and then usually two or three more characters to trigger some behavior like saying ⌘+o to open a file. By default it is set to backslash \\ Lots of people remap it to something else that they find easier to type or remember. [Read More]