Hi, I find it tedious to go all the way to the Escape key to stop some command (link-hints or text search, etc.) or to lose focus from edit mode. Is there a way (or can it be added) to map a custom key to do this job?
BTW, I'm really love Vimium because of its simplicity and unintrusiveness. It doesn't mess up with what the browser already has to offer. Thank you, guys! :)
I second this idea. I also think there should be a way to map to arrow keys and such (for expanding Vimium hotkeys to work as site hotkeys, eg; shift right arrow on Soundcloud). Should be support like .vimrc does;
I also think there should be a way to map to arrow keys and such (for expanding Vimium hotkeys to work as site hotkeys, eg; shift right arrow on Soundcloud).
@RobertCompton This is a much more difficult thing to implement; certainly, it is beyond the scope of the original issue. I have some ideas for how we might implement this, and, if you open a new issue for this, I will happily discuss them there.
On the topic of remapping Esc
. What is the use case? What would you expect the configuration/mapping to look like? Why should this be done in Vimium (as opposed to at the OS/window manager level)?
In vim I have
Would definitely be an advanced support feature, but would be really nice. Also mapping to other key combos instead of just commands in Vimium would allow for fantastic support of hotkeys native to sites. Not only could you add exclusions (as I have), but could map alternate commands for site hotkeys. This whole thing becomes pretty .rc, which someone already opened as issue for (and I think that's a fantastic idea).
Also mapping to other key combos instead of just commands in Vimium would allow for fantastic support of hotkeys native to sites.
As @mrmr1993 said, that's really another matter entirely.
On Esc
, I can see the use case. And it wouldn't, I think, be too hard or disruptive to implement it. @mrmr1993: I'm thinking just of pushing the mapping to the content script and extending the implementation of isEscapeKey
. What do you think, @mrmr1993? Would that work?
Would that work?
Should work, but I'm not really a fan.
I'd rather see something like
gmap <esc> exitCurrentMode
gmap <c-]> exitCurrentMode
in the default mappings (where gmap
means global map and exitCurrentMode
is the only gmap
-able command, at least for now), showing this command in the help dialog, and letting the user use this mechanism to specify their own keys/unmap the defaults.
isEscapeKey
is already a lie (because <c-]
isn't really escape), but I'd rather not make the situation worse, and just be a bit more honest in the code with what we're actually doing.
+1 for gmap. Looks neat and is clearly comprehensible.
I would also greatly benefit from this.
I would like to map <c-space>
to <esc>
, or something like that, because escape is very small on my keyboard and very far away from everything else. I always have to look down at the keyboard in order to hit escape which is far from ideal.
In vim I have jj
mapped to control-c
while in insert mode. If I ever need to type "jj", I simply use paste mode instead. This works great and I would love to have the equivalent in vimium.
On the same note, is there any other way to escape from a text box in vimium and get back to "command mode" without using the mouse or escape? It would be nice to have a key binding that always returns you to a base command mode state.
Would it not be better to do this at the OS/window-manager level? Presumably you'd want <c-space>
to close popups and dialogues too.
In emacs if I need to stop a command at any point and go back to a "base state" I type <Control-g>
. Stock vim does the same thing using <Control-c>
which exits insert mode putting the user back into command mode, the "base state".
I could map <esc>
to some more convenient keybinding at the OS/window-manager level, but this feels like there should be some other key binding for getting out of a text area or insert mode and back into command mode. Right now I only have the one option, <esc>
, and I have no means to map this inside of vimium to some other keybinding.
Also, <esc>
isn't a sure way to get back to a base state. Take for example when I'm focused on the location bar. When the address bar is in focus I have to press <tab tab>
to focus back onto the page, the base vimium state. This also has the unintended side effect of scrolling to the top of the page. (See here for a stackoverflow question regarding this).
Escaping out of a text area is a task I'm finding I do all the time while using vimium and it would be nice if Vimium had the vim equivalent of <Control-c>
. Granted, <Control-c>
would be a terrible binding since Chrome already uses this for "copy". I was thinking maybe <Control-space>
?
For reference, here is the vim wiki page "Avoid the escape key"
I would also like a different button for escaping out of things, the escape key is the only one where I have to stretch my hand far out of position and slows things down.
Most helpful comment
Should work, but I'm not really a fan.
I'd rather see something like
in the default mappings (where
gmap
means global map andexitCurrentMode
is the onlygmap
-able command, at least for now), showing this command in the help dialog, and letting the user use this mechanism to specify their own keys/unmap the defaults.isEscapeKey
is already a lie (because<c-]
isn't really escape), but I'd rather not make the situation worse, and just be a bit more honest in the code with what we're actually doing.