vim : Yanking doesn't work between file

2.3k Views Asked by At

I'm stuck up with a weird problem. I am trying to copy(yy) and paste(p) a line from one file to another (in split screen). It doesn't look it its working. However, yy, p works in the same file and with another file opened in another "tab". Would be really helpful if someone could tell me how to fix this. Spending a lot of time fixing this :(.

Thanks, Omkar

2

There are 2 best solutions below

0
lwassink On BEST ANSWER

You could also use a named buffer. If you yank with "ayy and put with "ap you can yank and put from any buffer to any other buffer in your vim session. You can use any other letter instead of a as the name of the buffer.

2
Omkar Manjunath On

This worked: set clipboard=unnamed