-
Notifications
You must be signed in to change notification settings - Fork 64
/
Mapping.txt
140 lines (118 loc) · 4.54 KB
/
Mapping.txt
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
*vital/Mapping.txt* Utilities for mapping / abbreviation.
Maintainer: tyru <[email protected]>
==============================================================================
CONTENTS *Vital.Mapping-contents*
INTRODUCTION |Vital.Mapping-introduction|
INTERFACE |Vital.Mapping-interface|
Functions |Vital.Mapping-functions|
==============================================================================
INTRODUCTION *Vital.Mapping-introduction*
*Vital.Mapping* is a utility functions related to |:map|, |:unmap|,
|:abbreviate|, |:unabbreviate| commands.
==============================================================================
INTERFACE *Vital.Mapping-interface*
------------------------------------------------------------------------------
FUNCTIONS *Vital.Mapping-functions*
*Vital.Mapping.execute_abbr_command()*
execute_abbr_command({mode}, {dict}, {lhs}, {rhs})
Execute `get_abbr_command(mode, dict, lhs, rhs)` result.
See |Mapping.get_abbr_command()|.
*Vital.Mapping.execute_map_command()*
execute_map_command({mode}, {dict}, {lhs}, {rhs})
Execute `get_map_command(mode, dict, lhs, rhs)` result.
See |Mapping.get_map_command()|.
*Vital.Mapping.execute_unmap_command()*
execute_unmap_command({mode}, {dict}, {lhs})
Execute `get_unmap_command(mode, dict, lhs)` result.
See |Mapping.get_unmap_command()|.
*Vital.Mapping.get_all_modes()*
get_all_modes()
Returns string which represents all mode characters ("noiclxs").
NOTE: "v" is not contained. Because "x" and "s" already mean "v".
*Vital.Mapping.get_all_modes_list()*
get_all_modes_list()
Returns |List| which represents all mode characters.
Same as `split(get_all_modes(), '\zs')` .
See |Mapping.get_all_modes()|.
*Vital.Mapping.get_abbr_command()*
get_abbr_command({mode}, {dict}, {lhs}, {rhs})
Constructs |:abbreviate| command string.
{mode} is a character of mode.
{dict} is a |Dictionary| of options.
{lhs} and {rhs} are strings of lhs/rhs of |:map| command.
The options can be created by |Mapping.options_chars2dict()| or
|maparg()|'s return value when {dict} is non-zero.
*Vital.Mapping.get_map_command()*
get_map_command({mode}, {dict}, {lhs}, {rhs})
Constructs |:map| command string.
{mode} is a character of mode.
{dict} is a |Dictionary| of options.
{lhs} and {rhs} are strings of lhs/rhs of |:map| command.
The options can be created by |Mapping.options_chars2dict()| or
|maparg()|'s return value when {dict} is non-zero.
*Vital.Mapping.get_unabbr_command()*
get_unabbr_command({mode}, {dict}, {lhs})
Constructs |:unabbreviate| command string.
{mode} is a character of mode.
{dict} is a |Dictionary| of options.
{lhs} is a string of lhs of |:map| command.
The options can be created by |Mapping.options_chars2dict()| or
|maparg()|'s return value when {dict} is non-zero.
*Vital.Mapping.get_unmap_command()*
get_unmap_command({mode}, {dict}, {lhs})
Constructs |:unabbreviate| command string.
{mode} is a character of mode.
{dict} is a |Dictionary| of options.
{lhs} is a string of lhs of |:map| command.
The options can be created by |Mapping.options_chars2dict()| or
|maparg()|'s return value when {dict} is non-zero.
*Vital.Mapping.options_chars2dict()*
options_chars2dict({chars})
{chars} is a string which represents characters of options.
The return value is a |Dictionary| which is same as |maparg()|'s
return value when {dict} is non-zero.
chars key ~
"e" expr
"b" buffer
"s" silent
"S" script
"u" unique
"r" noremap (inverse)
"n" nowait
Example: >
options_chars2dict("bs") = {
"expr": 0,
"buffer": 1,
"silent": 1,
"script": 0,
"unique": 0,
"noremap": 1,
"nowait": 0,
}
<
*Vital.Mapping.options_chars2raw()*
options_chars2raw({chars})
Same as `options_dict2raw(options_chars2dict(chars))` .
See |Mapping.options_dict2raw()| and |Mapping.options_chars2dict()|.
Example: >
options_dict2chars('eb') = '<expr><buffer>'
<
*Vital.Mapping.options_dict2chars()*
options_dict2chars({dict})
Converts {dict} to characters of options.
Example: >
options_dict2chars({'expr': 1, 'buffer': 1}) = 'eb'
<
*Vital.Mapping.options_dict2raw()*
options_dict2raw({dict})
{dict} is a |Dictionary| which represents options.
See |Mapping.options_chars2dict()| for the options.
Example: >
options_dict2raw({'expr': 1, 'buffer': 1}) = '<expr><buffer>'
<
*Vital.Mapping.is_mode_char()*
is_mode_char({char})
Returns non-zero if {char} is a character one of
"v", "n", "o", "i", "c", "l", "x", "s".
==============================================================================
vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl