Monday, January 09, 2012

Toggling Proxy settings quickly with Pentadactyl and Firefox

If you use the excellent Pentadactyl plugin for Firefox to get vim super-powers to the browser, here is a quick and painless way to toggle between a direct connection to the internet or using the default proxy settings. Add this to your ~/.pentadactylrc
command proxy -nargs=1 :set! network.proxy.type=<args>
nmap up :proxy 1<CR>
nmap np :proxy 0<CR>
Now pressing up (Use Proxy) will enable Manual Proxy Settings while pressing np (No Proxy) will use Direct Connection. network.proxy.type can take other values which might be suited to your setup. You can change the key bindings too.


  1. I think you have your nmap args wrong for the arrow keys. This is what worked for me:

    nmap <Up> :proxy 1<CR>
    nmap <Down> :proxy 0<CR>

    Regardless, thanks for the tip. This was just what I was looking for.

  2. :) Brandon, up is the letter 'u' followed by the letter 'p' and not the arrow keys

    Glad I could help!

  3. i got excited when i found a way to open blocked banned sites and it was fabulous and now i can open blocked sites when i am in office or work and keep in touch with friends by using
    Akinator UK proxy

  4. That's awesome, thanks a lot!

    Do you know if there's a way to display the proxy status in the pentadactyl status bar}