DOM formatter
[elinks/fonseca.git] / doc / exmode.txt
blobd35a62a9d4a55517fbf28f3c26fa2cc3c6fc3334
1 The tale of ex-mode
2 -------------------
4 Are you a vim-controls nerd who wants to see them everywhere?  Welcome.
6 Actually ELinks doesn't shine in this area yet very much. Heck, the famous
7 hjkl foursome is still occupied by some feeble managers in the default keymap
8 (we have that in our monumental TODO lists). Still, if you know what to touch
9 during the compilation (`\--enable-exmode`), you can get at least some familiar
10 reply to the mighty ``:'' (colon) grip.
13 What it is
14 ~~~~~~~~~~
16 Ex-mode gives you some (still very rough and only marginally complete) access
17 to advanced ELinks commands, to be invoked anywhere anytime, straight and
18 fast.
20 When you activate the ex-mode (named after the equivalent gadget in the vi
21 text editor flavours), a command line appears at the bottom of the screen for
22 you to type the commands.
24 Only two kinds of commands are supported so far. First, (almost?) anything
25 that can appear in the configuration file can be used in ex-mode. Second, you
26 can invoke (almost) any action from the ex-mode.
29 Configuration directives in exmode
30 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 There aren't many of these, so we can skim through them fast.
34 If you want to flip an option you know by name and refuse to engage with the
35 option manager visuals, you can just drop in to the ex-mode and type 'set
36 the.option = 1234'. See man elinks.conf (5) or the options manager for the
37 list of options; you can also get a complete options tree saved to elinks.conf
38 if you set 'config.saving_style' = 2 (but do *NOT* keep that setting unless
39 you know what are you doing; if we change a default value of some option in
40 future releases, we (generally) know what are we doing - this change won't
41 propagate to you during an upgrade if you already have the original default
42 value saved in your configuration file, though).
44 It's the same story with keybindings. You can use 'bind "main" "h" =
45 "move-cursor-left"'. It's not the same story with keybindings documentation.
46 There is the elinkskeys (5) manual page but it's horribly obsolete, so don't
47 rely on it. You can refer to the keybindings manager for names of actions and
48 even their short descriptions. Also, all the 'bind' commands are saved to the
49 configuration file if you set config.saving_style = 2 (but see above).
51 You can also use 'include my.conf', which will read my.conf as an ELinks
52 configuration file.
54 Actually, ELinks would eat '#blahblah blah' too, if you see a point in feeding
55 it that kind of stuff.
58 Actions in exmode - or exmode in action?
59 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 There is too many of these, so we should better skim through them fast.
63 Actually, we already talked about them. It's the last argument to the 'bind'
64 command. So, they are those listed in the keybinding manager. So if you enter
65 'move-cursor-left' command, it will move your cursor left - by a single
66 character, making this a little awkward, but it's useful if you sometimes want
67 to easily invoke an action and you don't want to waste a key for it.
69 Actually, actions could theoretically take arguments too. This is currently
70 implemented only for the 'goto-url' action, which can take the location it
71 should go at as a parameter (otherwise it opens the standard well-known dialog
72 as if you pressed 'g' in the default keymap).
74 Regarding the mysterious "(almost)" hinted above, you can never invoke the
75 "quit" action from the exmode - if you type it there, "really-quit" is invoked
76 instead.
79 How to use it
80 ~~~~~~~~~~~~~
82 It's simple. You press ':' (without the apostrophes, of course) and type in
83 the command, then you press enter.  E.g., ':set config.saving_style = 3' (this
84 is a good thing), ':quit' (and the game is over). The standard line-editing
85 facility is present (cursor keys and so), and the ex-mode input line has own
86 history.
89 The "but"s
90 ~~~~~~~~~~
92 The biggest usability hurdle so far is that there is no tab-completion. This
93 is why the ex-mode support is not enabled by default and part of the reason
94 why its practical usage is somewhat limited yet - if you don't remember
95 exactly what do you want to invoke, tough beans. Someone shall address this
96 issue in the future.
98 Also, perhaps wider scale of commands should be implemented in ex-mode. The
99 code is extremely flexible and it is very trivial to make another ex-mode
100 command handler, it's just that no one has done it yet ;-). Also, more actions
101 should be able to take arguments.