vimium-c icon indicating copy to clipboard operation
vimium-c copied to clipboard

Default to off on certain pages

Open jsrozner opened this issue 2 years ago • 6 comments

As described here, I am using f7 to toggle vimium status.

Currently vimium starts in enabled state on all pages. I would like to set it to be disabled on certain pages (and then enable it using f7 if I choose to).

So, e.g., I would have a config like site: gmail.com; default state: disabled

I suppose alternatively, vimium could be set so that, on page load of certain default-disabled sites, it automatically issues an f7 keypress which would achieve the same behavior.

jsrozner avatar Nov 03 '23 00:11 jsrozner

You may add a prefix of ^ into the Keys field of an exclusion rule, so that Vimium C will only hook the given keys on a matched page. See this: image

gdh1995 avatar Nov 12 '23 14:11 gdh1995

Thanks! But what I mean is that I'd like the initial state for vimium as enabled or disabled to be configurable per website.

So, for example, I could specify a list of websites for which vimium will initially be disabled on load. Then when I want to enable it on one of those sites, I will press f7.

Currently, each time I open a website like Gmail that has its own keyboard shortcuts I always need to press f7 to initially disable vimium. I do not want vimium to be permanently disabled on these sites because sometimes I do want to use vimium (e.g., to do things that they do not have keyboard shortcuts for).

jsrozner avatar Nov 27 '23 22:11 jsrozner

Um I'm not sure what's wrong. Please retry this:

image

The effect is: on a matched page (e.g. Vimium C Options itself), Vimium C is (almost completely) disabled by default, and then <f7> will make all key mappings in Vimium C work as expected, and a second <f7> can also disable them.

gdh1995 avatar Dec 03 '23 20:12 gdh1995

Yes, I have that, and it does work!

I am asking for some way to set up vimium so that it is initially enabled or disabled on certain sites. Currently vimium is always enabled when a new site is open. I'm asking how it could be set up, for example, like

Initially disabled on: gmail.com, docs.google.com

Then when loading gmail.com, vimium would be inactive until f7 is pressed

jsrozner avatar Dec 08 '23 22:12 jsrozner

Um not sure why you said so.

In my opinion, the method above exactly matches to be initially disabled until a F7, because:

  • you said initially disabled, while Vimium C won't respond on any other keys you pressed except <f7> - so you can just think Vimium C has been "disabled"
  • a <f7> does re-enable all other keys in Vimium C.

If the word disabled means to avoid "any influence on webpages", then it will be impossible to make Vimium C respond on <f7> - it must do something to listen on your keyboard actions.

gdh1995 avatar Dec 10 '23 17:12 gdh1995

If you just want a pattern to match gmail, then you may try :https://gmail.com/ and :https://docs.google.com/

gdh1995 avatar Dec 10 '23 17:12 gdh1995

I am sorry for the delay. So, say I want the following:

  • on all pages, I want f7 to toggle vimium state
  • on some collection of pages, (e.g., gmail, Google docs), I want Vimium to be initially disabled
  • on all other pages, I want vimium to be initially enabled

How can I achieve this?

jsrozner avatar Jul 24 '24 20:07 jsrozner

Well, just as the comment above:

  1. add such a key mapping rule:
map <f7> openUrl url="vimium://status/toggle/^\u0020<f7>"
  1. add some exclusion rules, like these:

    patterns Keys
    :https://gmail.com/ ^ <f7>
    :https://docs.google.com/ ^ <f7>

image

gdh1995 avatar Jul 25 '24 18:07 gdh1995

It does work! I was confused because I thought that the exclusion would persist even after toggling with f7. Thank you!

jsrozner avatar Jul 25 '24 20:07 jsrozner