With that anything you have ever yanked or deleted is in the ring and when you paste something you can easily rotate through the items in the ring. Basically you type 'p' to paste and if that's not what you wanted you keep pressing ctrl-p until you get what you want.
I used it (YankRing) for some time, but it was never consistent. The plus point is that it works across terminal, otoh often "p" did not work, so i would have to do "YRShow" and select.
Often this is used, but everything you delete gets copied to your clipboard.
set clipboard=unnamed
So i prefer to map C-c and C-x (or whatever) to copy/cut to clipboard.
" regardless of clipboard option, c-c copies selection to clip
vmap <C-c> "+y
" cut into clipboard
vmap <C-x> "+d
" copy to clipboard, http://news.ycombinator.com/item?id=4767227 , use 3 \y to copy 3 lines
map <leader>y "+yy
" paste from clipboard
map <leader>p "+p
" delete to black hole register, not going to clipboard etc
nnoremap <leader>d "_d
vnoremap <leader>d "_d
I've also mapped a key to write selected lines to a file, and another to read from it.
This was an incredibly helpful article. Tom Ryder's written a lot of other blog posts that were really insightful and enlightening as well. I even learned how to use ed from him.
His blog has taught me more about using vim than any other single resource, and I recommend it unreservedly to anyone thinking of starting out with vim.
Does anyone know of a service where I could point to "timeless" blog content like this and it would give me a feed that it picks old content on a random, perhaps weekly basis? Then I can integrate it with more timely sources.
I feel like this must exist but I've no idea what to Google for.
It works fine for me. Seems like whatever install of Vim you have doesn't support the clipboard. Run "vim --version | grep clipboard" and see if you get a + or - for the clipboard.
If you want a quick fix for getting it working again, make sure /usr/local/bin is early on in your PATH and run "brew install macvim --override-system-vim"
I find the difficulty is remembering this when I need it. I've read about capital registers several times, but when I am editing, and I need to copy several distinct lines, I do a "ayy "byy "cyy and then "ap "bp "cp instead of a "ayy "Ayy "Ayy -> "ap because I never remember to use capital registers. I'd love a VIM plugin that tells me that there is an easier way to what I just did by pattern matching my input.
Yeah me too. I guess it would need to match all the wrong ways against a right way. It is probably easy for something like "jjjjj", but already someone doing BBBBi instead of I would be difficult to match: because one would also need to see where he ended up with BBBB: beginning of line or somewhere in the middle
With that anything you have ever yanked or deleted is in the ring and when you paste something you can easily rotate through the items in the ring. Basically you type 'p' to paste and if that's not what you wanted you keep pressing ctrl-p until you get what you want.