disable Vimperator temporarily
Asked Answered
D

5

42

How can I disable Vimperator temporarily? For example, I'd like to disable Vimperator temporarily when I am using a web email app. Is there a command for it?

Dazzle answered 11/1, 2013 at 4:21 Comment(1)
<Insert> or <S-Escape> key to disable all Vimperator keys temporarily, enable it by hitting the key again. This feature may be introduced into Vimperator after Jan 11 2013.Gleeman
Q
35

I am guessing you already know about Shift-Esc to temporarily disable vimperator. So I wrote how to disable vimperator based on your current location.

First, the solution:

autocmd LocationChange .*                             js modes.passAllKeys = false
autocmd LocationChange mail\\.google\\.com            js modes.passAllKeys = true
autocmd LocationChange www\\.google\\.com/calendar    js modes.passAllKeys = true
autocmd LocationChange www\\.google\\.com/reader      js modes.passAllKeys = true
autocmd LocationChange mail\\.google\\.com/tasks      js modes.passAllKeys = false

This filters gMail, gCalendar, gReader, but not gTask.

The solution I gave is cascading approach where you define all websites to enable vimperator, then it selectively disables for each website. Thus, even though gTask uses the same parent site as gmail, it has vimperator enabled.

Now the explanation:

These commands go in your .vimperatorrc in the home directory. You can change the location of the .vimperatorrc by

source! *directory*

in .vimperatorrc file, but the default location is .vimperatorrc file in your home directory. (%userprofile% in Windows)

The alternative solution:

autocmd LocationChange .* js modes.passAllKeys = /mail\.google\.com/.test(buffer.URL)

*Notice the backslash to escape the dot.

The problem with this approach is that only the latest line of command with autocmd will take work. Meaning the last autocmd command overwrites the first. So you would end up resulting to boolean operation on the command, like this:

autocmd LocationChange .* js modes.passAllKeys = /(mail\.google\.com|google\.com\/reader)/.test(buffer.URL)

As you can see this can get complicated when you have many websites you want to filter out.

The documentation: http://vimperator.sourceforge.net/help/vimperator/autocommands.xhtml
Source of the solution: http://code.google.com/p/vimperator-labs/issues/detail?id=406

Quin answered 21/2, 2013 at 21:7 Comment(0)
J
53

Use Shift+Esc to temporarily disable Vimperator. Press it once again to make it work

Jodee answered 2/5, 2013 at 20:58 Comment(2)
Any idea what the equivalent is for Pentadactyl?Famous
@Famous Use passkeys command :set passkeys+=gmail.com:<Esc> This will ignore the Escape key on Gmail site.Jodee
Q
35

I am guessing you already know about Shift-Esc to temporarily disable vimperator. So I wrote how to disable vimperator based on your current location.

First, the solution:

autocmd LocationChange .*                             js modes.passAllKeys = false
autocmd LocationChange mail\\.google\\.com            js modes.passAllKeys = true
autocmd LocationChange www\\.google\\.com/calendar    js modes.passAllKeys = true
autocmd LocationChange www\\.google\\.com/reader      js modes.passAllKeys = true
autocmd LocationChange mail\\.google\\.com/tasks      js modes.passAllKeys = false

This filters gMail, gCalendar, gReader, but not gTask.

The solution I gave is cascading approach where you define all websites to enable vimperator, then it selectively disables for each website. Thus, even though gTask uses the same parent site as gmail, it has vimperator enabled.

Now the explanation:

These commands go in your .vimperatorrc in the home directory. You can change the location of the .vimperatorrc by

source! *directory*

in .vimperatorrc file, but the default location is .vimperatorrc file in your home directory. (%userprofile% in Windows)

The alternative solution:

autocmd LocationChange .* js modes.passAllKeys = /mail\.google\.com/.test(buffer.URL)

*Notice the backslash to escape the dot.

The problem with this approach is that only the latest line of command with autocmd will take work. Meaning the last autocmd command overwrites the first. So you would end up resulting to boolean operation on the command, like this:

autocmd LocationChange .* js modes.passAllKeys = /(mail\.google\.com|google\.com\/reader)/.test(buffer.URL)

As you can see this can get complicated when you have many websites you want to filter out.

The documentation: http://vimperator.sourceforge.net/help/vimperator/autocommands.xhtml
Source of the solution: http://code.google.com/p/vimperator-labs/issues/detail?id=406

Quin answered 21/2, 2013 at 21:7 Comment(0)
L
10

you could use :ignorekeys command

ignorekeys add mail.yahoo.com
ignorekeys add mail.google.com

to disable all vimperator keybinding when on those domains.

Lear answered 20/7, 2015 at 21:15 Comment(1)
What is the advantage of this over the other solutions?Uncoil
D
1

You can use the keyboard-shorcuts for gmail/feedly with feedSomeKeys (a plugin for Vimperator).

How?

  • Get this and this files.
  • Copy both files in ~/.vimperator/plugins (if doesn't exist create it).
  • Add this lines in your ~/.vimperatorrc file:

    :source ~/.vimperator/plugin_libly.js :command! -nargs=+ lazy autocmd VimperatorEnter .* :lazy fmaps -u='mail.google.com/mail' c / j k n p o u e x s r a # [ ] ? gi gs gt gd ga gc

  • Try it!

Destructive answered 10/7, 2013 at 5:12 Comment(1)
I can't add more than two links, so you have to google the gmail shorcuts. I recommend that clone the vimperator-plugin directory, so you can find one that like you: git clone github.com/vimpr/vimperator-plugins.gitDestructive
W
0

With autocmd solution, it could be annoying that every time message "Executing LocationChange Auto commands for ..." appears.

In latest version of vimperator (3.8.3) this message is not displayed by default, only in verbose mode.
But current version in Firefox Addons is 3.8.2, so we need to install it manually. Simple as:

git clone https://github.com/vimperator/vimperator-labs.git . 
make xpi

Then install vimperator from downloads directory.

Westerman answered 24/10, 2014 at 20:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.