vim

For discussion on all things (neo)vim.
NoahTheDuke 2021-02-26T18:07:19.001200Z

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

NoahTheDuke 2021-02-26T18:07:26.001500Z

has anyone experienced anything like that before?

NoahTheDuke 2021-02-26T18:07:48.002100Z

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

2021-02-26T20:03:47.002300Z

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

👍 1
2021-02-26T20:13:44.002800Z

you can use :registers to confirm what was yanked

2021-02-26T20:13:59.003100Z

but it sounds like it's an intermittent thing

NoahTheDuke 2021-02-26T20:16:50.003300Z

interesting, i'll try that, thanks

dave 2021-02-26T20:32:22.004100Z

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

NoahTheDuke 2021-02-26T20:52:37.004700Z

thanks for telling me about :registers, y'all

💯 1
2021-02-26T20:54:07.005800Z

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

1
rwstauner 2021-02-26T20:55:08.007300Z

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

NoahTheDuke 2021-02-26T20:55:29.007700Z

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

2021-02-26T21:04:24.007800Z

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

2021-02-26T21:04:39.008Z

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

rwstauner 2021-02-26T21:19:06.008200Z

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

2021-02-26T21:21:15.008400Z

right that shows up in the output of :registers too

👍 1