buffer.js: Properly fix lack of current buffer after removing a buffer
[conkeror.git] / help / tutorial.html
blob7985c918c099679344e4d1e293b8b35da17f8c50
1 <!DOCTYPE html
2 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <!--
5 (C) Copyright 2007,2011 John J. Foerch
7 Use, modification, and distribution are subject to the terms specified in the
8 COPYING file.
9 -->
11 <html xmlns="http://www.w3.org/1999/xhtml">
12 <head>
13 <title>Conkeror Tutorial</title>
14 <link rel="stylesheet" type="text/css" href="chrome://conkeror-help/content/manual.css" />
15 </head>
16 <body>
17 <h1>Conkeror Tutorial</h1>
19 <h3>Reading Key Notation</h3>
21 <p>
22 The first thing you need to know about Conkeror is how to read key
23 notation. Each key combination is written as a hyphenated list of
24 modifiers and key. The codes for the common modifiers are as
25 follows: <code class="key">C</code> means Control; <code class="key">M</code> means Meta or
26 Alt; and <code class="key">S</code> means Shift. Therefore the key combination
27 <code class="key">C-M-f</code> means to hold down Control and Meta and press
28 <code class="key">f</code>.
29 </p>
31 <p>
32 The key to scroll down is <code class="key">C-n</code>. The key to scroll up is
33 <code class="key">C-p</code>
34 </p>
36 <p>
37 Many commands in Conkeror are run by typing a sequence of two or
38 more key combinations. The notation is simple. Each combination in
39 the sequence is written, in order, separated by spaces. The
40 sequence <code class="key">C-h t</code> means to press Control-h, release all
41 keys, then press <code class="key">t</code>. <code class="key">C-h t</code> is the key
42 sequence to view this tutorial.
43 </p>
45 <p>
46 The key sequence to exit conkeror is <code class="key">C-x C-c</code>.
47 </p>
49 <p>
50 <code class="key">C-g</code> is the abort key. It is used to cancel a command
51 from the minibuffer, or stop a web page from loading.
52 </p>
54 <p>
55 <code class="key">Space</code> and <code class="key">Backspace</code> scroll a page down and
56 a page up, respectfully.
57 </p>
60 <h3>Basic Navigation</h3>
62 <p>
63 To browse to an URL in a new content buffer, type <code class="key">C-x
64 C-f</code>. This key sequence works from anywhere in Conkeror.
65 Additionally, if you are already in a content buffer (as opposed to a
66 buffer showing download progress or help), you can navigate the current
67 buffer to a new url with the <code class="key">g</code> (find-url) key.
68 The mnemonic is "go". The key sequence <code class="key">C-x C-v</code>
69 (find-alternate-url) is also available in content buffers. It is
70 identical to <code class="key">g</code> except that the prompt will be
71 pre-filled with the current URL for you to edit.
72 </p>
74 <p>
75 The <code class="key">B</code> key (note uppercase) is bound to
76 the <code>back</code> command. Practice basic navigation by
77 typing <code class="key">g</code> and entering the text "about:" in
78 the url prompt. To come back to this tutorial from the about: page,
79 type <code class="key">B</code>.
80 </p>
83 <h3>Hinting</h3>
85 <p>
86 The system for interacting with the elements of a document is called
87 the hinting system. With the hinting system, you can do things like
88 follow hyperlinks, copy URLs, focus form fields, and more. Let's
89 use the hinting system to follow a hyperlink. You will receive
90 instructions about how to return here after you follow the
91 hyperlink. If the numbered list and hyperlink following this
92 paragraph are not in view, scroll so that they are.
93 </p>
95 <ol>
96 <li>Press <code class="key">f</code>. (mnemonic: follow)</li>
97 <li>The hyperlink should be hilighted, with a number on the left
98 side. Type that number and hit enter.</li>
99 </ol>
102 <a href="chrome://conkeror-help/content/back-forward.html">This is a
103 hyperlink.</a>
106 As a matter of fact, in addition to following links by number, you can
107 also follow them by a substring of the link text. You could select the
108 link above by typing <code class="key">f t h i s</code>. When more than
109 one link with similar text is in view, hinting will narrow down the
110 choices as you type. You can always specify the one you want by
111 disambiguating the sequence with the hint number.
112 </p>
115 But hinting is for more than just hyperlinks. Conkeror provides
116 several <em>hint classes</em> for operating on different types of
117 elements. The hint class is specified by typing the corresponding
118 key sequence of the class before the key sequence of the command.
119 It was not necessary to specify a hint class for following the
120 hyperlink above because links are the default hint class for the
121 follow command. The following table lists the most common hint
122 classes.
123 </p>
125 <table>
126 <tr><td><em>key</em></td><td><em>hint class</em></td><td><em>mnemonic</em></td></tr>
127 <tr><td><code class="key">n</code></td><td>links and form elements</td><td>li<b>n</b>k</td></tr>
128 <tr><td><code class="key">i</code></td><td>images</td><td><b>i</b>mage</td></tr>
129 <tr><td><code class="key">m</code></td><td>frameset frames and top window</td><td>fra<b>m</b>e</td></tr>
130 <tr><td><code class="key">* *</code></td><td>dom nodes</td><td>wildcard</td></tr>
131 </table>
134 In the hinting system, hint number zero (0) is special. It refers to the
135 current URL in the buffer.
136 </p>
139 The <code class="key">c</code> key is bound to the copy command. Its
140 default hint class is links. To copy the URL of the page you are
141 currently browsing, type <code class="key">c 0</code>. To copy the url of
142 a frame or iframe, type <code class="key">m c</code>. If there is more
143 than one frame visible, you will be prompted for a number, just as with
144 hyperlinks.
145 </p>
148 When none of the conventional hint classes cover the element that
149 you want to operate on, you can use the dom-nodes hint class, to
150 choose from among all visible dom nodes. This hint class is bound
151 to <code class="key">* *</code>. Try copying the text of this
152 paragraph now by typing <code class="key">* * c</code> followed by
153 the hint number for this paragraph.
154 </p>
157 <h3>Finding Text (Isearch)</h3>
159 <code class="key">C-s</code> invokes interactive text search mode, isearch
160 for short. <code class="key">C-r</code> invokes reverse isearch. In this
161 mode, just type the text you want to find into the minibuffer and Conkeror
162 will search the document as you type. To jump to the next match,
163 hit <code class="key">C-s</code> again. To jump to the previous match,
164 hit <code class="key">C-r</code>. To conclude your search,
165 hit <code class="key">return</code>, or to abort it,
166 press <code class="key">escape</code> or <code class="key">C-g</code>. If
167 you have previously concluded an isearch, you can use the
168 keys <code class="key">S</code> and <code class="key">R</code> to jump to
169 next and previous matches without going back into isearch mode. This is
170 called non-interactive resume. To resume your last successful isearch in
171 interactive mode, hit <code class="key">C-s</code>
172 or <code class="key">C-r</code> twice.
173 </p>
175 <h3>Copying Text</h3>
177 Apart from <code class="key">* * c</code> described above, there are other
178 ways to copy text for times when what you want to copy does not neatly
179 fill one dom node. The process is straight-forward. First, use isearch
180 (<code class="key">C-s</code>) and search for the start of the text you
181 want to copy. When you have brought the search to the start of the text
182 you want to copy, hit <code class="key">return</code> to conclude the
183 search. Although no cursor is visible, there is an invisible cursor where
184 the search concluded. Hold the <code class="key">shift</code> key and use
185 the arrow keys to make a selection. When you have selected the text you
186 want to copy, release all keys and hit <code class="key">M-w</code> to
187 copy the text to the clipboard.
188 </p>
191 <b>Tip:</b> Although isearch is usually the quickest way to position the
192 cursor, there are other ways. One of them is to use the <em>focus
193 link</em> browser-object command (<code class="key">n ;</code>). When you
194 focus a link, the invisible cursor will be left at the first character of
195 the link text, and you can use shifted arrow keys to make a selection from
196 that point. If the methods outlined so far are unsuitable for a situation
197 you encounter, then you can use <code>M-x caret-mode</code> to get a small
198 but visible blinking cursor that you can move to where you need it.
199 Call <code>M-x caret-mode</code> again to toggle it off.
200 </p>
202 <h3>What Next</h3>
204 Now that you've completed the tutorial, you should have the basic skills
205 to get around on the web. But there is so much more to learn, and
206 always the possibility of improving your efficiency through
207 configuration. Start by reading
208 the <a href="http://conkeror.org/QuickStart">QuickStart</a>, and then
209 explore the <a href="http://conkeror.org/">Conkeror Wiki</a> on your
210 own. Enjoy!
211 </p>
213 </body>
214 </html>