I frequently find myself wanting to make a copy of, eg, a function that I just wrote and modify it slightly. In such a situation, I'll generally use something like y5k to copy what I just wrote. I then have to 5j or `` to get back to where I just was before p.However, if I'm at the start of what I want to copy, y5j will not move the cursor to the end of what I just yanked, meaning that I still have to 5j before I p. This behavior is mentioned briefly in the help files:After applying the operator the cursor is mostly left at the start of  the text that was operated upon.  For example, yfe doesn't move the  cursor, but yFe moves the cursor leftwards to the e where the yank  started.But it doesn't give a rationale for which motions move the cursor and which don't, or a way to change these behaviors.So, long story short: how can I yank upwards (or in any particular direction) without moving the cursor?
Keep cursor from moving when yanking upwards
cursor movement;cut copy paste
You can take a different approach for this exact situation.Paste differentlyThe gP command pastes before your cursor like P, but leaves your cursor to the end of the pasted text instead of before.This is effectively identical to manually restoring your cursor position before pasting with p.