Fork me on GitHub
#vim
<
2021-02-26
>
Noah Bogart18:02:19

I'm having a bit of trouble recently where I'll select a bit of text, yank it, move somewhere new, and then press p to paste, and the entire function is pasted in instead

Aleksander20:02:47

maybe Plug 'machakann/vim-highlightedyank' and :registers can help debug?

👍 3
Noah Bogart18:02:26

has anyone experienced anything like that before?

Noah Bogart18:02:48

it happens rarely enough that i can't pinpoint which plug-in is causing it

noisesmith20:02:44

you can use :registers to confirm what was yanked

noisesmith20:02:59

but it sounds like it's an intermittent thing

Noah Bogart20:02:50

interesting, i'll try that, thanks

dave20:02:22

While we're on the subject of being sure what you yanked, I just stumbled upon this plugin today and installed it, and it's great. It solves a problem I didn't know that I had 😄 https://github.com/machakann/vim-highlightedyank

Noah Bogart20:02:37

thanks for telling me about :registers, y'all

💯 3
noisesmith20:02:07

it's also great when you yanked or cut something a few edits back and want to use it again without undo

truestory 3
rwstauner20:02:08

yeah, registers are great when you plan ahead, though (aside from the + register) i rarely use them anymore since i started using yankring

noisesmith21:02:24

the key thing is that previous yanks show up in the registers automatically, though using the paste / undo cycle browses them as well

noisesmith21:02:39

you don't need to plan ahead for them any more than you do when using the yank ring

rwstauner21:02:06

oh nice. i was thinking of naming registers (`"a`, etc)

noisesmith21:02:15

right that shows up in the output of :registers too

👍 3
Noah Bogart20:02:29

looks like something is inserting the whole function def into the * register, think it has to do with coc.nvim, but i don't have the time to dig into that, so i'll just use the " register to stay safe