philc / vimium

The hacker's browser.
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb
MIT License
23.63k stars 2.49k forks source link

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

Closed murermader closed 4 years ago

murermader commented 4 years ago

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 commented 4 years ago

<c-[> works like escape.

---Original--- From: "murermader"<notifications@github.com> Date: Sun, Feb 9, 2020 21:00 PM To: "philc/vimium"<vimium@noreply.github.com>; Cc: "Subscribed"<subscribed@noreply.github.com>; Subject: [philc/vimium] Is there a way to exit insert mode, other than pressing escape? (#3485)

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?

β€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

murermader commented 4 years ago

How exactly does that help me?

gdh1995 commented 4 years ago

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 commented 4 years ago

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

gdh1995 commented 4 years ago

c-[ support mapkey, so you may write: mapkey <c-]> <c-[>

---Original--- From: "pingz"<notifications@github.com> Date: Thu, Feb 13, 2020 12:10 PM To: "philc/vimium"<vimium@noreply.github.com>; Cc: "Mention"<mention@noreply.github.com>;"Dahan Gong"<gdh1995@qq.com>; Subject: Re: [philc/vimium] Is there a way to exit insert mode, other than pressing escape? (#3485)

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

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

pingz commented 4 years ago

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

murermader commented 4 years ago

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 commented 4 years ago

You may try mapkey Ctrl+E to Ctrl+[ , then it will be easier to exit insert mode - mapkey can map any key to the c-[

---Original--- From: "murermader"<notifications@github.com> Date: Sat, Feb 15, 2020 00:38 AM To: "philc/vimium"<vimium@noreply.github.com>; Cc: "Mention"<mention@noreply.github.com>;"Dahan Gong"<gdh1995@qq.com>; Subject: Re: [philc/vimium] Is there a way to exit insert mode, other than pressing escape? (#3485)

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!

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

murermader commented 4 years ago

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 commented 4 years ago

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

hraban commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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

yassinebridi commented 3 years ago

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

gdh1995 commented 3 years ago

you may need 'mapkey' to let another key act like 'c-[' during Vimium handling it. Then your browser won't notice a 'c-['. 

---Original--- From: "Yassine Bridi"<notifications@github.com> Date: Tue, Dec 29, 2020 02:23 AM To: "philc/vimium"<vimium@noreply.github.com>; Cc: "Mention"<mention@noreply.github.com>;"Dahan Gong"<gdh1995@qq.com>; Subject: Re: [philc/vimium] Is there a way to exit insert mode, other than pressing escape? (#3485)

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

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

hraban commented 3 years ago

@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 commented 3 years ago

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

hraban commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

I think it may be because Chrome decides to exit full-screen mode on ctrl-[, but not Chrome receives/translates ctrl-[ to escape.

---Original--- From: "pingz"<notifications@github.com> Date: Mon, Jan 4, 2021 11:11 AM To: "philc/vimium"<vimium@noreply.github.com>; Cc: "Mention"<mention@noreply.github.com>;"Dahan Gong"<gdh1995@qq.com>; Subject: Re: [philc/vimium] Is there a way to exit insert mode, other than pressing escape? (#3485)

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.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.