Skip to content

Instantly share code, notes, and snippets.

@mentalisttraceur
Last active March 16, 2023 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mentalisttraceur/799ff0c7882e71d25d91df1d2a2a6032 to your computer and use it in GitHub Desktop.
Save mentalisttraceur/799ff0c7882e71d25d91df1d2a2a6032 to your computer and use it in GitHub Desktop.
zsh vi-like P
function vi-put-before()
{
local cursor_position=$CURSOR &&
zle .vi-put-before &&
CURSOR=$cursor_position
}
zle -N vi-put-before
@mentalisttraceur
Copy link
Author

mentalisttraceur commented Oct 22, 2022

.zsh-vi-P fixes capital P in vi-mode so that the cursor is left in front of the entire pasted text after the paste.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment