My Blog Personal archive
Posts with the tag vim:

Use Vim's Registers to Mimic Killring

The so called ‘kill ring’ is that the content you kill (delete or yank) in an editor will be stored in a stack like place. Later you could cycle through the items in the stack by pressing shortcuts without worrying about losing the text you killed previously.

There’re a lot plugins for vim to mimic this behavior, like yankstack.vim, yankring.vim. Unfortunately, these plugins change too much of vim’s default behavior and often conflict with many other plugins.

So I did a little research to see if I could achieve this function with vim’s built-in features, and it turns out vim’s register could fulfill my need easily.