1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-01 08:55:46 +01:00
Files
pentadactyl-pm/locale/en-US/autocommands.txt
2008-08-14 10:53:52 +00:00

50 lines
1.8 KiB
Plaintext

HEADER
|autocommands| +
Autocommands are a way to automatically execute code when certain events
happen.
|:au| |:autocmd| +
||:au[tocmd]|| Execute commands automatically on events.
________________________________________________________________________________
[c]:au[tocmd][c] {event} {pat} {cmd}.
Add {cmd} to the list of commands Vimperator will execute on {event} for a URL matching {pat}:
* [c]:autocmd[!][c] {events} {pat}: list/remove autocommands filtered by {events} and {pat}
* [c]:autocmd[!][c] {events}: list/remove autocommands matching {events}
* [c]:autocmd[!][c] * {pat}: list/remove autocommands matching {pat}
* [c]:autocmd[!][c]: list/remove all autocommands
Available {events}:
`----------------`--------------------------------------------
*LocationChange* Triggered when changing tabs or when navigating to a new location
*PageLoadPre* Triggered after a page load is initiated.
*PageLoad* Triggered when a page gets (re)loaded/opened
*Quit* Triggered before exiting Firefox
*Startup* Triggered after Firefox starts
--------------------------------------------------------------
{pat} is a regular expression, use .* if you want to match all URLs.
________________________________________________________________________________
section:Examples[autocmd_examples]
Enable _passthrough_ mode on all Google sites:
:au LocationChange .* js modes.passAllKeys = /google\.com/.test(buffer.URL)
Enable _passthrough_ mode on *some* Google sites:
:au LocationChange .* js modes.passAllKeys = /(www|mail)\.google\.com/.test(buffer.URL)
Set the filetype to mail when editing email at Gmail:
:au LocationChange .* :set editor=gvim -f
:au LocationChange mail\.google\.com :set editor=gvim -f -c 'set ft=mail'
// vim: set syntax=asciidoc: