mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-06 10:04:11 +01:00
Most of the special case asciidoc replacements were also removed since they're a bit confusing and doing so results in a 60% improvement in the time taken by asciidoc to process the help pages. Unfortunately, I'm now limited to preparing a three course menu for my guests while it runs rather than the degustation extravaganzas of the past but such is life. It's still a bit of a mess but since we're almost certainly moving to something else in the near future it's probably not worth cleaning it up before 2.0 is released.
90 lines
3.9 KiB
Plaintext
90 lines
3.9 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}:
|
|
|
|
`--------------------`----------------------------------------
|
|
*BookmarkAdd* Triggered after a page is bookmarked
|
|
*ColorScheme* Triggered after a color scheme has been loaded
|
|
*DOMLoad* Triggered when a page's DOM content has fully loaded
|
|
*DownloadPost* Triggered when a download has completed
|
|
*Fullscreen* Triggered when the browser's fullscreen state changes
|
|
*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
|
|
*ShellCmdPost* Triggered after executing a shell command with :!cmd
|
|
*VimperatorEnter* Triggered after Firefox starts
|
|
*VimperatorLeavePre* Triggered before exiting Firefox, just before destroying each module
|
|
*VimperatorLeave* Triggered before exiting Firefox
|
|
--------------------------------------------------------------
|
|
|
|
{pat} is a regular expression, use .* if you want to match all URLs.
|
|
|
|
Note: This differs from Vim which uses a glob rather than a regexp for {pat}.
|
|
|
|
The following keywords are available where relevant:
|
|
|
|
`--------------`----------------------------------------------
|
|
*<url>* The URL against which the event was selected.
|
|
*<title>* The page, bookmark or download title.
|
|
*<tab>* The index tab in which the event occurred.
|
|
*<tags>* The tags applied to <url>. Only for *BookmarkAdd*.
|
|
*<keyword>* The keywords applied to the bookmark. Only for *BookmarkAdd*.
|
|
*<icon>* The icon associated with <url>. Only for *BookmarkAdd*.
|
|
*<size>* The size of a downloaded file. Only for *DownloadPost*.
|
|
*<file>* The target destination of a download. Only for *DownloadPost*.
|
|
*<state>* The new fullscreen state. Only for *Fullscreen*.
|
|
*<name>* The color scheme name. Only for *ColorScheme*.
|
|
--------------------------------------------------------------
|
|
|
|
________________________________________________________________________________
|
|
|
|
|
|
|:doautoa| |:doautoall|
|
|
||:doautoa[ll] {event} [a][url][a]|| +
|
|
________________________________________________________________________________
|
|
Apply the autocommands matching the specified URL to all buffers. If no
|
|
[a][url][a] is specified use the current URL.
|
|
________________________________________________________________________________
|
|
|
|
|
|
|:do| |:doautocmd|
|
|
||:do[autocmd] {event} [a][url][a]|| +
|
|
________________________________________________________________________________
|
|
Apply the autocommands matching the specified URL to the current buffer. If no
|
|
[a][url][a] is specified use the current URL.
|
|
________________________________________________________________________________
|
|
|
|
section:Examples[autocmd-examples]
|
|
|
|
Enable _passthrough_ mode on all Google sites:
|
|
|
|
:autocmd LocationChange .* js modes.passAllKeys = /google\.com/.test(buffer.URL)
|
|
|
|
Enable _passthrough_ mode on *some* Google sites:
|
|
|
|
:autocmd LocationChange .* js modes.passAllKeys = /(www|mail)\.google\.com/.test(buffer.URL)
|
|
|
|
Set the filetype to mail when editing email at Gmail:
|
|
|
|
:autocmd LocationChange .* :set editor=gvim\ -f
|
|
:autocmd LocationChange mail\.google\.com :set editor="gvim -f -c 'set ft=mail'"
|
|
|
|
// vim: set syntax=asciidoc:
|