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

Is there a way to exit insert mode, other than pressing escape? #3485

Closed
murermader opened this issue Feb 9, 2020 · 20 comments
Closed

Is there a way to exit insert mode, other than pressing escape? #3485

murermader opened this issue Feb 9, 2020 · 20 comments

Comments

@murermader
Copy link

I am trying to escape insert mode without using the escape key. I couldn't find the "exit insert mode function" so I can't map a key to it.

The reason I am asking is that I am often using hotkeys from websites to enter video full screen mode (for example f on youtube). Once I am in fullscreen, I want to get rid of the insert mode block at the bottom of the screen, without leaving fullscreen mode (pressing ESC).

Is there any way to do this in the current version of vimium, or is that a functionality that could be implemented?

@gdh1995
Copy link
Contributor

gdh1995 commented Feb 9, 2020 via email

@murermader
Copy link
Author

How exactly does that help me?

@gdh1995
Copy link
Contributor

gdh1995 commented Feb 10, 2020

You can press <c-[> (Ctrl+[) to exit (most if not all) modes of Vimium, and this accepts mapkey, so mapkey <c-c> <c-[> will make <c-c> work like <esc>.

@pingz
Copy link

pingz commented Feb 13, 2020

@gdh1995 not the same thing, you still quit the fullscreen and insert mode at the same time. c-[ is identical to Esc.

@gdh1995
Copy link
Contributor

gdh1995 commented Feb 13, 2020 via email

@pingz
Copy link

pingz commented Feb 13, 2020

Oh, I get it. The original c-[ is not the same as in mapkey <c-[> <c-[>.

@murermader
Copy link
Author

I can't get the CTRL + [ to work, maybe because I am using a german keyboard layout (QWERTZ), where I have to press CTRL + Alt Gr + 8 to get the (Alt Gr + 8 for [) character, but it does not seem to work.

My solution that I am currently quite happy with, is just disabling the insert mode block in the advance settings. That works as well.

Anyway, thanks for the help!

@gdh1995
Copy link
Contributor

gdh1995 commented Feb 15, 2020 via email

@murermader
Copy link
Author

Thanks, that works! I mixed up the order of the mapkey parameters when trying it out for myself, but just swapping them made it work. Appreciate the help👍

@cheecheeo
Copy link

@gdh1995 thanks for all the pointers, i wonder if this could be made any more discoverable via documentation.

@hraban
Copy link

hraban commented Jun 4, 2020

another use for this: youtube has a hotkey to go fullscreen (f), but that only works in insert mode; pressing ESC then will exit fullscreen rather than hide that insert mode modal at the bottom. This workaround doesn't do that.

So to go full screen in youtube you can do ifCtrl+[

@murermader
Copy link
Author

@hraban yes, this is why i posted this on github. I guess I'll close this issue, as it is resolved.

From the issue text:

The reason I am asking is that I am often using hotkeys from websites to enter video full screen mode (for example f on youtube)

@hraban
Copy link

hraban commented Jun 4, 2020

all my apologies, I will say twenty hail maries and do penance. consider my vile words unspoken.

@yassinebridi
Copy link

@hraban it still exits full screen, ctrl+[ acts like escape.

@gdh1995
Copy link
Contributor

gdh1995 commented Dec 29, 2020 via email

@hraban
Copy link

hraban commented Dec 29, 2020

@hraban it still exits full screen, ctrl+[ acts like escape.

Ah, in that case this might depend on the OS or browser. On Mac, neither Chrome nor FF interpret ctrl+[ as the esc key. I'm curious to know which browser / OS combo emulates terminal escape keys, if you have it?

@yassinebridi
Copy link

Actually the system itself doesn't intrepret ctrl+[ as esc, but chrome does.
I'm using chrome: 87, Arch linux

@hraban
Copy link

hraban commented Jan 3, 2021

Actually the system itself doesn't intrepret ctrl+[ as esc, but chrome does.
I'm using chrome: 87, Arch linux

Nice. Chrome 87 + Mac definitely doesn't do this. But interesting that they've gone that way on Arch.

@pingz
Copy link

pingz commented Jan 4, 2021

Actually the system itself doesn't intrepret ctrl+[ as esc, but chrome does.
I'm using chrome: 87, Arch linux

Nice. Chrome 87 + Mac definitely doesn't do this. But interesting that they've gone that way on Arch.

It is a C0 control code. Xorg just pass key events to applications. Maybe it is GTK or something.

@gdh1995
Copy link
Contributor

gdh1995 commented Jan 4, 2021 via email

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

6 participants