Open
Conversation
Problem: In visual mode, `y` should yank the selected text without delay.
A visual mode classic-surround keybind, ys<surround>, causes a
delay on yanking in visual mode due to the common `y` prefix
shared between yank and this surround action.
Solution: Remove the visual mode classic-surround keybind `ys`, since this
is not a visual mode surround keybind in tpope/vim-surround.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
ZVM_VI_SURROUND_BINDKEY=classic(default) and in visual mode,yhas a delay ofZVM_KEYTIMEOUTbefore it yanks. In the video I set the timeout to 1.4 seconds to make the delay easier to notice. In my experience, this delay is noticeable during the actual usage of the plugin even when the timeout has the default value of 0.4 seconds.vis-mode-delay-on-y.mp4
Solution
Remove the visual mode classic-mode-surround keybind
ys<surround>.The visual mode
ys<surround>keybind causes the delay since there are two visual mode keybinds that start withy:yitself andys<surround>. By removing the latter thenycan be resolved immediately. I've reviewed vim-surround and there is noys<surround>visual mode keymap, so I think that removing this keybind is sensible (although it can be considered a breaking change). No change whenZVM_VI_SURROUND_BINDKEY=s-prefix. Behavior from this branch:vis-mode-delay-on-y-fixed.mp4
Notes
The videos were recorded using vhs (from this PR) with this tape file so the inputs are exactly the same on both tests:
vis-mode-delay-on-y.tapeThanks for the plugin!