How to copy the long hash of the commit under the cursor? #116
-
I frequently need to find a commit in the history and copy its long hash. I'm aware of Currently, I press This is pretty tedious because I have to switch to the mouse and aim correctly to highlight the full hash and only the hash. If at least the hash was contained in the commit window, I could copy it with standard normal mode commands using only the keyboard. Do you have any advice how to reach my goal in an easier way? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I just found out that I can do That's already an improvement, but I hope there's a quicker way |
Beta Was this translation helpful? Give feedback.
-
Put this autocmd in your flog augroup, in your vimrc:
Now |
Beta Was this translation helpful? Give feedback.
Put this autocmd in your flog augroup, in your vimrc:
Now
yh
copies the git hash into the '+' register, assuming you need it outside of vim. Otherwise, change that to the empty string for the default (unnamed) register, then justp
will paste it.