philc / vimium

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

Modes to deal with Vimium vs site specific shortcuts #1287

Closed rkpatel33 closed 8 years ago

rkpatel33 commented 9 years ago

Is it possbile to implement a 'normal' mode and 'insert' mode concept, such that on sites like Gmail:

I could even see this extending to a 'desktop' Vimium application so you can navigate your OS without the mouse and using relavent Vim commands in different settings (things like entering text in text fields/boxes).

mrmr1993 commented 9 years ago

I've opened a PR (#1288) which adds an option to suppress page commands outside insert mode.

smblott-github commented 9 years ago

@rkpatel33...

normal mode blocks native gmail shortcuts/allows only vimium shortcuts

What's your use case for wanting this?

maximbaz commented 9 years ago

@rkpatel33, that's a very cool feature request!

@smblott-github, to give you an insight: sites like gmail, trello or bitbucket provide their own set of hotkeys, which may interfere with vimium. When they do interfere, it is very annoying if you cannot control which key set are you going to use: vimium or native.

For example, you are on a https://mail.google.com/ page. There are a few emails in the inbox, one is selected by default. You want to navigate to the settings page. To do that, you would press f, find out a keystroke assigned to the Settings button and press it. What happens instead: after you press f, currently selected mail is opened for forwarding.

The best thing you can do today is to completely disable vimium for gmail... but that's wrong!

I tried the pull request by @mrmr1993 on the gmail page, it works nicely. You can choose which key set you want to use: vimium (in normal mode) or native (in insert mode), you can also choose to completely disable this feature in the options (which is disabled by default, by the way).

smblott-github commented 9 years ago

The best thing you can do today is to completely disable vimium for gmail... but that's wrong!

Much of this is addressed by the passkeys feature which is currently in master, and which will be in the next release. These are my settings:

snapshot

The listed keys are passed through to gmail, and all other Vimium keys are handled by Vimium as usual. So, you pick which GMail shortcuts you want to use, and which Vimium bindings you want to retain.

maximbaz commented 9 years ago

@smblott-github, I agree that this is better than just disabling vimium for entire website, but still looks to me more like a workaround.

For every single page:

Moreover, as far as I understand, as soon as you defined a key to be passed to the page, you cannot use it anymore in vimium.

In the example above, a person may still want to use both: f as forward selected email and f as find in vimium. It is much easier to achieve with the concept of normal/insert modes, where you definitely know, which effect will hitting f bring.

rkpatel33 commented 9 years ago

The use case it to be able to use vimium AND site-specific shortcuts, depending on current mode, and to be able to switch between them on the fly, instead of setting it up so that certain keys are passed through vimiim on certain sites.

I’m sure there are ins and outs that i have not thought of, but thought it was very vimium-onic conceptually.

On Dec 13, 2014, at 9:18 AM, Stephen Blott notifications@github.com<mailto:notifications@github.com> wrote:

@rkpatel33https://github.com/rkpatel33...

normal mode blocks native gmail shortcuts/allows only vimium shortcuts

What's your use case for wanting this?

— Reply to this email directly or view it on GitHubhttps://github.com/philc/vimium/issues/1287#issuecomment-66877724.

maximbaz commented 9 years ago

Having said that, after I fetched the latest code from the master, I get exactly the behavior I described. By default vimium catches its hotkeys (no reaction from gmail when I press f), and if I enter the insert mode, gmail's hotkeys enter the game (mail is opened for forwarding). So I can only assume I had too old version of the vimium.

@rkpatel33, you may want to try updating your vimium as well (and make sure you don't have any excluded URLs in the vimium options).

Now, as the only thing left discussing in this pull request is about unhandled keys, I would not argue that this is really required feature.

mrmr1993 commented 9 years ago

Having said that, after I fetched the latest code from the master, I get exactly the behavior I described.

Yes, I fixed the issue where certain pages were getting the events before us in #1219. The fix should land in the webstore version soon.

Now, as the only thing left discussing in this pull request is about unhandled keys, I would not argue that this is really required feature.

It's not required, but it might be nice to (optionally) have a strict distinction between the modes; ie. in normal mode you can only run Vimium commands, and in insert mode you can run page commands.

AdrieanKhisbe commented 8 years ago

Seem to be already implemented. Just tested on a trello board. Should be close?

smblott-github commented 8 years ago

Closing. In light of pass keys, it's not clear that there's any action needed.

ghost commented 8 years ago

How can I get a block cursor when I navigate using vimium . without a visual cursor I just don't know where I was . One thing , what if I want to copy a word on a webpage ? please help !

ghost commented 8 years ago

It would be great if vimium support vimiumrc .

ghost commented 8 years ago

Esc is far away from reach . It would nicer if there's a handy key map for Esc

johnmolino commented 8 years ago

Probably not the answer your looking for - but if you are into keyboard shortcuts (you wouldn't be here if you weren't so that's a given) - and you probably already know all this, but in the event you do not... I am truly sorry to do this to you .....Look into getting an HHKB keyboard and mod it with a Teensy controller and code from Hasu from Geekhack - the world is your oyster ....

WARNING...on the off chance you don't know what I'm talking about - these links WILL 1) eat up your time, 2) lighten your wallet 3) possibly cause a divorce and 3) ultimately consume you: (OK I'm kidding about the divorce)... https://geekhack.org/index.php?PHPSESSID=afjevpth96rs81k12db5oevcbo2flk1q&topic=57008.0 https://elitekeyboards.com/products.php?sub=pfu_keyboards,hhkbpro2&pid=pdkb400b

But yeah it would be nicer to have a key map for Esc. :)

(Sorry if this was a little off - topic)