by gorgoiler · 4y ago · 0 comments
Well:
1/ copy URL from browser
2/ alt tab to vim notes
3/ delete old URL from notes
4/ paste new URL but get the old URL instead?!
How do I do the FORTH equivalent of swapping the two items on the top of the stack (and have a stack in the first place)? :)
To paste the copied URL instead of the deleted one, you can paste from the 0 register by using "0p.
Otherwise, depending on your system, pasting from the * or + registers (using "*p or "+p) will paste what you copied from the browser.
One solution I have in vim which I always forget to use is adding an additional d or p to use a secondary paste buffer:
vnoremap dd "ad
nnoremap ddd "add
nnoremap pp "ap
:[range]m[ove] {address}
Some common remaps: vnoremap <c-j> :m '>+1<CR>gv=gv
vnoremap <c-k> :m '<-2<CR>gv=gv
inoremap <c-j> <Esc>:m .+1<CR>==gi
inoremap <c-k> <Esc>:m .-2<CR>==gi
nnoremap <leader>j :m .+1<CR>==
nnoremap <leader>k :m .-2<CR>==Having the common deletion operation also default to adding to clipboard is a design mistake in Vim, I feel.
I also really like junegunn/vim-peekaboo, which really helps if I know I copied something, but I'm not sure how far down the stack it is.
This works even if I ssh into something.