I want to yank the selected line in visual mode in Neovim v0.6.0. In Neovim v0.5.0 and Vim, I use "Y" in visual mode to achieve this. However, due to the following changes in neovim v0.6.0, the behavior of "Y" has changed and this method is no longer available.
https://github.com/neovim/neovim/pull/13268
Can you please tell me how to yank by line in Neovim 0.6.0 or later?
y$in Visual mode does not make much sense, as it results in "visual"yfollowed by "normal"$. For this reason, in Neovim there's no mapping for "visual"Y. At least in the current commit (:map Yto check it once again).But if you really encounter such thing, you can always remove a mapping with
unmap(oriunmap,vunmap, etc.). Or even create another one usingnnoremap(orinoremap,xnoremap, etc.). Here "nore" guarantees that the right-hand-side always refers to the original meaning, not to one of:h default-mappings.