philc / vimium

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

Escape insert mode with custom shortcut #706

Closed MrJJJ closed 10 years ago

MrJJJ commented 12 years ago

In vim, I like to escape insert mode with jk. The escape key is really annoying to tap.

bernardobarreto commented 11 years ago

You are at insert mode, that means you can type whatever you want. jk is far not a good approach, if this already existed while you were creating this issue and you typed jk fast it would exited the insert mode. For this issue I think would be better to use a letter plus alt, ctrl... In VIM, I use alt + l to leave insert mode, it's really comfortable for me, could be used in vimium too. What do you guys think, @MrJJJ, @philc and @ilya ?

MrJJJ commented 11 years ago

Nobody type jk by accident (these 2 letters are very uncommon in words), and this is a popular choice in vim. I like my vimium the most close than my true vimrc, so for me, this is the best choice. But I can understand that other people prefer something like alt+ or ctrl+ something. Why not give the choice to the user ?

bernardobarreto commented 11 years ago

"Nobody type jk by accident (these 2 letters are very uncommon in words)" but I cant type it anyway, I can't type alt, that's is my point.

ghost commented 11 years ago

@MrJJJ how about mapping the escape key to capslock ?

MrJJJ commented 11 years ago

My capslock is mapped on Ctrl (incredibly convenient for many, many things, this is by the best custom thing I made in all my life).

Maybe an interesting setting if map Esc to something like jj or jk is a problem, map Esc on Ctrl-C (as in vim). But I think it could be a problem in chrome (I don't think we can use default shortcut of google, and Ctrl-c is for copy in chrome).

philc commented 11 years ago

@MrJJJ If you're on a mac, you can remap capslock to both esc and ctrl by having a naked keypress of caps lock be interpreted as escape. Changed my life. https://github.com/tekezo/KeyRemap4MacBook

MrJJJ commented 11 years ago

I am on ubuntu, but such a software on linux would be great.

daGrevis commented 11 years ago

<C-c> is one thing I'm missing!

joshvoigts commented 11 years ago

I second @daGrevis <C-c> please!

rgrinberg commented 11 years ago

I use jk in vim and would love to have a similar mapping for vimium.

daGrevis commented 11 years ago

Is it really that hard to implement <C-c>? http://stackoverflow.com/a/2904944/458610

I'm not asking for .vimrc (Vimperator for Firefox has it) that allows you to map crazy things like @rgrinberg described.

wilsonandcompany commented 10 years ago

+1

horta1212 commented 10 years ago

bernardofire addressed why a default jk for an esc keystroke would be a bad idea. wouldn't be hard to implement, but the guidelines for Vimium as a Chrome plugin point towards letting Chrome win when there're conflicting key-binds. In this case, is copy for Chrome. The way around this is to allow people to map command keystrokes, but as addressed here: https://github.com/philc/vimium/issues/301 , it's not a simple issue due to the way Vimium was architected. This issue has been open 3 years without progress so I'm not sure it'll ever happen. It's sad because I do love the ctrl-c functionality of many versions of vim on the various platforms. Interestingly, gVim allows ctrl-c to perform both functions depending upon which mode you're in.

philc commented 10 years ago

Closing in favor of #301.

EquipoP commented 6 years ago

jk is a pretty common thing to write nowadays (https://www.urbandictionary.com/define.php?term=jk) and it could also appear in some places like variable names or something.