-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.user_modes
59 lines (34 loc) · 1.68 KB
/
README.user_modes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
What is included with USER_MODES:
"create-mode" - Create a new, user-defined named mode with optional
initialization commands and an empty keymap. You can
then populate the keymap with "define-key."
Examples:
create-mode "mymode"
create-mode "mymode_tab4" "local-set-tabs 4 0"
define-key mymode "\r" newline-and-indent
"delete-mode" - Delete a mode.
"copy-mode" - Copy a mode with its key assignments. The commands are
not copied.
Example:
copy-mode clike mymode "new commands"
"rename-mode" - Rename a mode.
"list-modes" - List the modes and any initialization-commands.
"local-set-mode" - Set the mode in the current buffer. If the mode has
initialization commands, run them first.
"local-unset-mode" - Clear the mode from the current buffer.
"local-toggle-mode" - Toggle the mode in the current buffer.
These commands can operate on user-defined modes, and on builtin
language-modes, but not on other builtin modes.
"local-set-mode", "local-unset-mode" and "local-toggle-mode" are
included with LANGMODE_CLIKE.
Mode names are case-sensitive and can include any character in your
locale.
When USER_MODES is defined, "list-keymaps" is an alias of "list-
modes".
Rationales:
"create-mode": "define-key" and "local-set-key" aren't particularly useful without it.
"delete-mode": the names of builtin language modes should not be reserved.
"copy-mode": it's tedious to copy all key assignments.
"rename-mode": trivial to do, completeness, perhaps useful.
"local-toggle-mode": more useful interactively than -set and -unset.
"local-set-mode", "local-unset-mode": more comfortable to use in a script than a toggle.