-
Notifications
You must be signed in to change notification settings - Fork 76
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
Handle delay when exiting into vim normal mode #216
Comments
I can't believe that you went that far. Yes, your workaround is definitely the fix for the issue. I believe that the recommended value for Maybe at some points, we could expose the two settings to users. |
Yes or no. It is not possible based on how common terminal works, |
If PR is welcome, I can give it a try. |
As a side note. After working with this for a while, I noticed that those timeouts only affect workflow if there are For example, if there is a radian binding |
Your observation is correct. It is exactly how prompt toolkit handles the key bindings. |
@echasnovski, your solution is great. I was going to do something similar to change the cursor shape based on the current vim mode, but I decided to edit the Python code instead of writing an R hook in an |
Hello, @randy3k! I wanted to share my problem, its current workaround, and ask for any suggestions and possibilities of new radian settings.
By default, when using
"vim"
editing mode there is a rather long delay when exiting from insert into normal mode after hitting<Esc>
key. It is tolerable if noradian.escape_key_map
is defined and long otherwise.I believe, it is present in order to enable
escape_key_map
functionality. However, I use those keymappings with<Alt>
key so I don't really need any delay when hitting<Esc>
. I didn't find any setting in radian which can help with this.My current workaround is as follows. As radian uses Python's 'prompt_toolkit', there is a way to modify that delay. Currently it is defined by
ttimeoutlen
andtimeoutlen
properties ofApplication
class. Their default values are 0.5 and 1 seconds. After experimenting, it seems that delay of 0.5 is "used" when noescape_key_map
is defined and 1.5 (0.5+1) otherwise. Inspired by this comment, I implemented the following workaround (which is added to '.radian_profile'):Currently this works for me. Is there any chance of getting "official" radian settings which can help with this issue? The ultimate solution would be two settings: enabling
<Alt>
key mappings instead of<Esc>
and those[t]timeoutlen
s, but I don't believe both of them are possible, are they?The text was updated successfully, but these errors were encountered: