Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay changing line numbers after exiting Insert Mode #54

Open
superjamie opened this issue Feb 4, 2023 · 1 comment
Open

Delay changing line numbers after exiting Insert Mode #54

superjamie opened this issue Feb 4, 2023 · 1 comment

Comments

@superjamie
Copy link

superjamie commented Feb 4, 2023

tl;dr - This isn't your fault, and I come bearing multiple solutions.

After hitting Esc to exit Insert Mode, my Vim/Neovim would wait a second or so before setting line numbers back to relative. This was really annoying and broke the workflow of quick responsive changes.

After a lot of debugging, I found this was caused by another binding I had which started with <Esc>. Vim was waiting for the timeoutlen to see if I'd hit anything else after I hit the Esc key. I didn't more keys so then it ran the mode change which fires with this plugin, hence the delay in changing line numbers.

Users can find keymaps like this with:

:verbose imap <Esc>

Reference: vim/vim#1498 (comment)

The solution for me was to just remove the other <Esc> mapping, I'll pick another key combination for what I had.

Another solution is probably to reduce the timeoutlen to say 50ms like this, though it might make other keybinds harder to hit:

set timeoutlen=50

If you're interested in adding an FAQ section to the readme with things like this, I'm happy to send a PR to save you the effort? There are one or two other things here in Issues over the years which could be in such an FAQ too.

Otherwise, feel free to close this Issue. Discussions aren't enabled on this repo so I didn't see anywhere else to post.

Also, many thanks for your excellent plugin! You've made my Vim experience a lot better. This and hardtime really got me using vertical line motions properly.

@superjamie
Copy link
Author

Ha, spoke too soon, I also needed to add set -sg escape-time 1 to ~/.tmux.conf for it to work in tmux! The tmux default is 500ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant