Closed buzypi closed 7 years ago
Use yy
instead of Y
or remap Y
to yy
while
Please close the PR if you are satisfied with my answer or give me a good reason to follow the native Vim's mapping :+1: .
That sounds reasonable. I didn't know yy works.
Personally I've found the non-standard behavior of CodeMirror to vim/vi behavior of Y quite interrupts my workflow. Anyone have a snippet they could share to change this setting for jupyter (completely understand not wanting to deviate from CodeMirror's mappings)?
Here it is for posterity:
// Configure CodeMirror
require([
'nbextensions/vim_binding/vim_binding', // depends your installation
], function() {
// Map Y to yy
CodeMirror.Vim.map("Y", "yy", "normal");
});
(And restart your notebook, which I forgot to do. woops! 😸 )
Please feel free to edit https://github.com/lambdalisue/jupyter-vim-binding/wiki/Customization 👍
done, thanks!
Summary
When you yank a link in Vim using Y and press p, it pastes the entire line that the cursor is currently in the next line and positions the cursor in the newly created line.
Step by step procedure
Actual
A part of the line gets copied in between the existing line.
Expected
The entire line should get copied in the next line and the cursor must be positioned in the new line.
Remarks
Thanks for the binding. :)