1
- *vital/Mapping.txt* Utilities for mapping.
1
+ *vital/Mapping.txt* Utilities for mapping / abbreviation .
2
2
3
3
Maintainer: tyru <
[email protected] >
4
4
@@ -12,14 +12,129 @@ INTERFACE |Vital.Mapping-interface|
12
12
==============================================================================
13
13
INTRODUCTION *Vital.Mapping-introduction*
14
14
15
- *Vital.Mapping* is TODO
15
+ *Vital.Mapping* is a utility functions related to | :map | , | :unmap | ,
16
+ | :abbreviate | , | :unabbreviate | commands.
16
17
17
18
==============================================================================
18
19
INTERFACE *Vital.Mapping-interface*
19
20
------------------------------------------------------------------------------
20
21
FUNCTIONS *Vital.Mapping-functions*
21
22
22
- TODO
23
+ *Mapping.execute_abbr_command()*
24
+ execute_abbr_command({mode} , {dict} , {lhs} , {rhs} )
25
+ Execute `get_abbr_command(mode, dict, lhs, rhs)` result.
26
+ See | Mapping.get_abbr_command() | .
27
+
28
+ *Mapping.execute_map_command()*
29
+ execute_map_command({mode} , {dict} , {lhs} , {rhs} )
30
+ Execute `get_map_command(mode, dict, lhs, rhs)` result.
31
+ See | Mapping.get_map_command() | .
32
+
33
+ *Mapping.execute_unmap_command()*
34
+ execute_unmap_command({mode} , {dict} , {lhs} )
35
+ Execute `get_unmap_command(mode, dict, lhs)` result.
36
+ See | Mapping.get_unmap_command() | .
37
+
38
+ *Mapping.get_all_modes()*
39
+ get_all_modes()
40
+ Returns string which represents all mode characters ("noiclxs").
41
+ NOTE: "v" is not contained. Because "x" and "s" already mean "v".
42
+
43
+ *Mapping.get_all_modes_list()*
44
+ get_all_modes_list()
45
+ Returns | List | which represents all mode characters.
46
+ Same as `split(get_all_modes(), '\zs')` .
47
+ See | Mapping.get_all_modes() | .
48
+
49
+ *Mapping.get_abbr_command()*
50
+ get_abbr_command({mode} , {dict} , {lhs} , {rhs} )
51
+ Constructs | :abbreviate | command string.
52
+ {mode} is a character of mode.
53
+ {dict} is a | Dictionary | of options.
54
+ {lhs} and {rhs} are strings of lhs/rhs of | :map | command.
55
+ The options can be created by | Mapping.options_chars2dict() | or
56
+ | maparg() | 's return value when {dict} is non-zero.
57
+
58
+ *Mapping.get_map_command()*
59
+ get_map_command({mode} , {dict} , {lhs} , {rhs} )
60
+ Constructs | :map | command string.
61
+ {mode} is a character of mode.
62
+ {dict} is a | Dictionary | of options.
63
+ {lhs} and {rhs} are strings of lhs/rhs of | :map | command.
64
+ The options can be created by | Mapping.options_chars2dict() | or
65
+ | maparg() | 's return value when {dict} is non-zero.
66
+
67
+ *Mapping.get_unabbr_command()*
68
+ get_unabbr_command({mode} , {dict} , {lhs} )
69
+ Constructs | :unabbreviate | command string.
70
+ {mode} is a character of mode.
71
+ {dict} is a | Dictionary | of options.
72
+ {lhs} is a string of lhs of | :map | command.
73
+ The options can be created by | Mapping.options_chars2dict() | or
74
+ | maparg() | 's return value when {dict} is non-zero.
75
+
76
+ *Mapping.get_unmap_command()*
77
+ get_unmap_command({mode} , {dict} , {lhs} )
78
+ Constructs | :unabbreviate | command string.
79
+ {mode} is a character of mode.
80
+ {dict} is a | Dictionary | of options.
81
+ {lhs} is a string of lhs of | :map | command.
82
+ The options can be created by | Mapping.options_chars2dict() | or
83
+ | maparg() | 's return value when {dict} is non-zero.
84
+
85
+ *Mapping.options_chars2dict()*
86
+ options_chars2dict({chars} )
87
+ {chars} is a string which represents characters of options.
88
+ The return value is a | Dictionary | which is same as | maparg() | 's
89
+ return value when {dict} is non-zero.
90
+
91
+ chars key ~
92
+ "e" expr
93
+ "b" buffer
94
+ "s" silent
95
+ "S" script
96
+ "u" unique
97
+ "r" noremap (inverse)
98
+ "n" nowait
99
+
100
+ Example: >
101
+ options_chars2dict("bs") = {
102
+ "expr": 0,
103
+ "buffer": 1,
104
+ "silent": 1,
105
+ "script": 0,
106
+ "unique": 0,
107
+ "noremap": 1,
108
+ "nowait": 0,
109
+ }
110
+ <
111
+ *Mapping.options_chars2raw()*
112
+ options_chars2raw({chars} )
113
+ Same as `options_dict2raw (options_chars2dict (chars))` .
114
+ See | Mapping.options_dict2raw() | and | Mapping.options_chars2dict() | .
115
+
116
+ Example: >
117
+ options_dict2chars('eb') = '<expr><buffer>'
118
+ <
119
+ *Mapping.options_dict2chars()*
120
+ options_dict2chars({dict} )
121
+ Converts {dict} to characters of options.
122
+
123
+ Example: >
124
+ options_dict2chars({'expr': 1, 'buffer': 1}) = 'eb'
125
+ <
126
+ *Mapping.options_dict2raw()*
127
+ options_dict2raw({dict} )
128
+ {dict} is a | Dictionary | which represents options.
129
+ See | Mapping.options_chars2dict() | for the options.
130
+
131
+ Example: >
132
+ options_dict2raw({'expr': 1, 'buffer': 1}) = '<expr><buffer>'
133
+ <
134
+ *Mapping.is_mode_char()*
135
+ is_mode_char({char} )
136
+ Returns non-zero if {char} is a character one of
137
+ "v", "n", "o", "i", "c", "l", "x", "s".
23
138
24
139
==============================================================================
25
140
vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl
0 commit comments