]> git.donarmstrong.com Git - dactyl.git/blob - common/locale/en-US/autocommands.xml
Import 1.0b7.1 supporting Firefox up to 8.*
[dactyl.git] / common / locale / en-US / autocommands.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <?xml-stylesheet type="text/xsl" href="dactyl://content/help.xsl"?>
3
4 <!DOCTYPE document SYSTEM "dactyl://content/dtd">
5
6 <document
7     name="autocommands"
8     title="&dactyl.appName; Autocommands"
9     xmlns="&xmlns.dactyl;"
10     xmlns:html="&xmlns.html;">
11
12 <h1 tag="autocommands">Automatic commands</h1>
13 <toc start="2"/>
14
15 <p>
16     Autocommands are a way to automatically execute code when
17     certain events happen.
18 </p>
19
20 <item>
21     <tags>:au :autocmd</tags>
22     <spec>:au<oa>tocmd</oa><oa>!</oa> <oa>events</oa> <oa>filter</oa> <oa>cmd</oa></spec>
23     <description>
24         <p>Execute commands automatically on events.</p>
25
26         <p>
27             When <oa>cmd</oa> is not given, list all commands
28             defined for the given <oa>events</oa> and <oa>filter</oa>.
29             When <oa>!</oa> is given, delete the matching commands
30             rather than listing them.
31         </p>
32
33         <p>
34             When <oa>cmd</oa> is given, add it to the list of commands to be
35             executed when <oa>events</oa> occur for pages matching the
36             comma-separated list of <t>site-filters</t>, <oa>filter</oa>. If the
37             <em>-javascript</em> (short name <em>-js</em>) option is given,
38             <oa>cmd</oa> is interpreted as JavaScript code. Otherwise, it is
39             interpreted as an Ex command.
40         </p>
41
42         <p>
43             If the <em>-group</em>=<a>group</a> flag is given, add this autocmd
44             to the named <t>group</t>. Any filters for <a>group</a> apply in
45             addition to <oa>filter</oa>. When listing commands this limits the
46             output to the specified group.
47         </p>
48
49         <p>Available <oa>events</oa>:</p>
50
51         <dl tag="autocommand-list"/>
52
53         <p>
54             For Ex <oa>cmd</oa>s, the following keywords are
55             replaced with the appropriate value before the commands
56             are executed. For JavaScript commands, they may be
57             accessed as ordinary variables, sans angle brackets.
58         </p>
59
60         <dl tag="autocommand-args"/>
61     </description>
62 </item>
63
64 <item>
65 </item>
66
67 <item>
68     <tags>:doautoa :doautoall</tags>
69     <spec>:doautoa<oa>ll</oa> <a>event</a> <oa>url</oa></spec>
70     <description>
71         <p>
72             Apply all <a>event</a> autocommands matching the
73             specified <oa>url</oa> to all buffers. If no
74             <oa>url</oa> is specified use the current URL.
75         </p>
76     </description>
77 </item>
78
79 <item>
80     <tags>:do :doautocmd</tags>
81     <spec>:do<oa>autocmd</oa> <a>event</a> <oa>url</oa></spec>
82     <description>
83         <p>
84             Apply all autocommands matching the specified
85             <oa>url</oa> to the current buffer. If no <oa>url</oa>
86             is specified use the current URL.
87         </p>
88     </description>
89 </item>
90 <h2 tag="autocmd-examples">Examples</h2>
91
92 <p>Enable <em>Pass Through</em> mode on all Google sites:</p>
93
94 <code><ex>:autocmd LocationChange</ex> <str delim="">google.com</str> <ex>:normal!</ex> <k name="C-z"/></code>
95
96 <p>Enable <em>Pass Through</em> mode on <em>some</em> Google sites:</p>
97
98 <code><ex>:autocmd LocationChange</ex> <str delim="'">^https?://(www|mail)\.google\.com/</str> <ex>:normal!</ex> <k name="C-z"/></code>
99
100 <p>or</p>
101
102 <code><ex>:autocmd LocationChange</ex> <str delim="">www.google.com</str>,<str delim="">mail.google.com</str> <ex>:normal!</ex> <k name="C-z"/></code>
103
104 <p>Set the filetype to mail when editing email at Gmail:</p>
105
106 <code><ex>:autocmd LocationChange</ex> !<str delim="">mail.google.com</str>,<str delim="">*</str> <se opt="editor" op="&amp;"/>
107 <ex>:autocmd LocationChange</ex> <str delim="'">mail.google.com</str> <se opt="editor"><str>gvim -f -c 'set ft=mail' +&lt;line></str></se></code>
108
109 </document>
110
111 <!-- vim:se sts=4 sw=4 et: -->