Skip to content

Commit 5db171b

Browse files
authored
Merge pull request #250 from mnishz/map_for_Vim_8.1
Update map from Vim 8.0 to 8.1
2 parents 09b324f + d8026cf commit 5db171b

File tree

2 files changed

+46
-10
lines changed

2 files changed

+46
-10
lines changed

doc/map.jax

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*map.txt* For Vim バージョン 8.0. Last change: 2017 Mar 10
1+
*map.txt* For Vim バージョン 8.1. Last change: 2018 May 13
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -53,6 +53,7 @@
5353
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
5454
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
5555
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
56+
:tma[p] {lhs} {rhs} |mapmode-t| *:tma* *:tmap*
5657
キー入力 {lhs}{rhs} に割り当てます。作成したマップ
5758
は、マップコマンドに対応したモードで使用できます。マッ
5859
プが使用されたときに {rhs} が調べられ、再マップされま
@@ -69,6 +70,7 @@
6970
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
7071
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
7172
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
73+
:tno[remap] {lhs} {rhs} |mapmode-t| *:tno* *:tnoremap*
7274
キー入力 {lhs}{rhs} に割り当てます。作成したマッ
7375
プ、はマップコマンドに対応したモードで使用できます。
7476
{rhs} は再マップされないので、マップが入れ子になったり
@@ -87,6 +89,7 @@
8789
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
8890
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
8991
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
92+
:tunma[p] {lhs} |mapmode-t| *:tunma* *:tunmap*
9093
マップコマンドに対応したモードの {lhs} というマップを
9194
削除します。他のモードのマップは残ります。
9295
Note: 末尾の空白は {lhs} に含まれます。次の unmap コマ
@@ -104,6 +107,7 @@
104107
:imapc[lear] |mapmode-i| *:imapc* *:imapclear*
105108
:lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear*
106109
:cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear*
110+
:tmapc[lear] |mapmode-t| *:tmapc* *:tmapclear*
107111
マップコマンドに対応したモードのすべてのマップを削除し
108112
ます。{Vi にはありません}
109113
バッファローカルなマップを削除するには <buffer> 引数を
@@ -120,6 +124,7 @@
120124
:im[ap] |mapmode-i|
121125
:lm[ap] |mapmode-l|
122126
:cm[ap] |mapmode-c|
127+
:tma[p] |mapmode-t|
123128
マップコマンドに対応したモードのすべてのマップを一覧表
124129
示します。Note: ":map" と ":map!" は複数のモードを表示
125130
できるのでよく使われます。
@@ -134,6 +139,7 @@
134139
:im[ap] {lhs} |mapmode-i| *:imap_l*
135140
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
136141
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
142+
:tma[p] {lhs} |mapmode-t| *:tmap_l*
137143
マップコマンドに対応したモードの {lhs} で始まるマップ
138144
を一覧表示します。
139145
{Vi にはありません}
@@ -313,6 +319,7 @@ Note: 特殊キーが機能するようにしたり、テキスト中の CSI バ
313319
:imap :inoremap :iunmap 挿入
314320
:lmap :lnoremap :lunmap 挿入、コマンドライン、Lang-Arg
315321
:cmap :cnoremap :cunmap コマンドライン
322+
:tmap :tnoremap :tunmap 端末ジョブ
316323

317324
{訳注: Lang-Argについては |language-mapping| を参照}
318325

@@ -359,6 +366,10 @@ NOTE: 選択モードで印字可能文字にマップを定義するとユー
359366
Vim では ":nmap"、":vmap"、":omap"、":cmap"、":imap" を使い分けることで、それ
360367
ぞれのモード別にマップを設定することができます。
361368

369+
*mapmode-t*
370+
端末マップは、端末ウィンドウの中で動作しているジョブに対してキーが入力されたと
371+
きに機能します。|terminal-typing| を参照してください。
372+
362373
*omap-info*
363374
オペレータ待機マップを使うと、移動コマンドを定義できます。そして、オペレータと
364375
組み合わせて使うことができます。簡単な例: ":omap { w" を定義した場合、"y{"
@@ -417,6 +428,7 @@ CTRL-U (<C-U>) を使って (Vimによって挿入される) 範囲指定を削
417428
i 挿入
418429
l 挿入、コマンドライン、Lang-Argでの ":lmap" マップ
419430
c コマンドライン
431+
t 端末ジョブ
420432

421433
{訳注: Lang-Argについては |language-mapping| を参照}
422434

@@ -890,7 +902,9 @@ non-id "non-id" タイプは非キーワード文字で終わります。他
890902

891903
full-id マッチした場所の前が非キーワード文字、行頭、挿入を開始した場所、であ
892904
ること。例外: 短縮入力が1文字の場合、その前の文字がスペース、タブ、
893-
以外の非キーワード文字なら短縮入力は展開されません。
905+
以外の非キーワード文字なら短縮入力は展開されません。ただし、コマンド
906+
ラインにおける "'<,'>" (もしくはその他のマーク) は無視され、コマンド
907+
ラインがその後から始まっているように動作します。
894908

895909
end-id マッチした場所の前が非キーワード文字、スペース、タブ、行頭、挿入を開
896910
始した場所、であること。
@@ -1243,6 +1257,7 @@ script2.vimを実行すると "None" が表示されます。期待した結果
12431257
属性を指定しない場合、ユーザー定義コマンドの入力時に引数は補完されません。下記
12441258
の属性のうちいずれか1つを指定することで、引数が補完されるようになります。
12451259

1260+
-complete=arglist 引数リスト内のファイル名
12461261
-complete=augroup オートコマンドのグループ
12471262
-complete=buffer バッファ
12481263
-complete=behave |:behave| サブオプション
@@ -1262,6 +1277,7 @@ script2.vimを実行すると "None" が表示されます。期待した結果
12621277
-complete=highlight 強調グループ
12631278
-complete=history |:history| サブオプション
12641279
-complete=locale ロケール名 (locale -a の出力)
1280+
-complete=mapclear バッファ引数
12651281
-complete=mapping マップ
12661282
-complete=menu メニュー
12671283
-complete=messages |:messages| サブオプション
@@ -1393,6 +1409,8 @@ Note これらの引数は省略できますが、これは廃止される機能
13931409
<line1> コマンド範囲の最初の行
13941410
*<line2>*
13951411
<line2> コマンド範囲の最後の行
1412+
*<range>*
1413+
<range> コマンド範囲を指定するために使われた要素の数: 0, 1 もしくは 2
13961414
*<count>*
13971415
<count> 与えられたカウント('-range' と '-count' 属性で記述されている)
13981416
*<bang>*

en/map.txt

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*map.txt* For Vim version 8.0. Last change: 2017 Mar 10
1+
*map.txt* For Vim version 8.1. Last change: 2018 May 13
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -29,7 +29,7 @@ manual.
2929
1. Key mapping *key-mapping* *mapping* *macro*
3030

3131
Key mapping is used to change the meaning of typed keys. The most common use
32-
is to define a sequence commands for a function key. Example: >
32+
is to define a sequence of commands for a function key. Example: >
3333
3434
:map <F2> a<C-R>=strftime("%c")<CR><Esc>
3535
@@ -55,6 +55,7 @@ modes.
5555
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
5656
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
5757
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
58+
:tma[p] {lhs} {rhs} |mapmode-t| *:tma* *:tmap*
5859
Map the key sequence {lhs} to {rhs} for the modes
5960
where the map command applies. The result, including
6061
{rhs}, is then further scanned for mappings. This
@@ -71,6 +72,7 @@ modes.
7172
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
7273
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
7374
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
75+
:tno[remap] {lhs} {rhs} |mapmode-t| *:tno* *:tnoremap*
7476
Map the key sequence {lhs} to {rhs} for the modes
7577
where the map command applies. Disallow mapping of
7678
{rhs}, to avoid nested and recursive mappings. Often
@@ -87,6 +89,7 @@ modes.
8789
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
8890
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
8991
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
92+
:tunma[p] {lhs} |mapmode-t| *:tunma* *:tunmap*
9093
Remove the mapping of {lhs} for the modes where the
9194
map command applies. The mapping may remain defined
9295
for other modes where it applies.
@@ -105,6 +108,7 @@ modes.
105108
:imapc[lear] |mapmode-i| *:imapc* *:imapclear*
106109
:lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear*
107110
:cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear*
111+
:tmapc[lear] |mapmode-t| *:tmapc* *:tmapclear*
108112
Remove ALL mappings for the modes where the map
109113
command applies. {not in Vi}
110114
Use the <buffer> argument to remove buffer-local
@@ -121,6 +125,7 @@ modes.
121125
:im[ap] |mapmode-i|
122126
:lm[ap] |mapmode-l|
123127
:cm[ap] |mapmode-c|
128+
:tma[p] |mapmode-t|
124129
List all key mappings for the modes where the map
125130
command applies. Note that ":map" and ":map!" are
126131
used most often, because they include the other modes.
@@ -135,6 +140,7 @@ modes.
135140
:im[ap] {lhs} |mapmode-i| *:imap_l*
136141
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
137142
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
143+
:tma[p] {lhs} |mapmode-t| *:tmap_l*
138144
List the key mappings for the key sequences starting
139145
with {lhs} in the modes where the map command applies.
140146
{not in Vi}
@@ -185,7 +191,7 @@ that starts with ",". Then you need to type another character for Vim to know
185191
whether to use the "," mapping or the longer one. To avoid this add the
186192
<nowait> argument. Then the mapping will be used when it matches, Vim does
187193
not wait for more characters to be typed. However, if the characters were
188-
already type they are used.
194+
already typed they are used.
189195

190196
*:map-<silent>* *:map-silent*
191197
To define a mapping which will not be echoed on the command line, add
@@ -318,6 +324,7 @@ Overview of which map command works in which mode. More details below.
318324
:imap :inoremap :iunmap Insert
319325
:lmap :lnoremap :lunmap Insert, Command-line, Lang-Arg
320326
:cmap :cnoremap :cunmap Command-line
327+
:tmap :tnoremap :tunmap Terminal-Job
321328

322329

323330
COMMANDS MODES ~
@@ -358,6 +365,10 @@ Therefore the ":map" and ":map!" commands enter and display mappings for
358365
several modes. In Vim you can use the ":nmap", ":vmap", ":omap", ":cmap" and
359366
":imap" commands to enter mappings for each mode separately.
360367

368+
*mapmode-t*
369+
The terminal mappings are used in a terminal window, when typing keys for the
370+
job running in the terminal. See |terminal-typing|.
371+
361372
*omap-info*
362373
Operator-pending mappings can be used to define a movement command that can be
363374
used with any operator. Simple example: ":omap { w" makes "y{" work like "yw"
@@ -418,6 +429,7 @@ When listing mappings the characters in the first two columns are:
418429
i Insert
419430
l ":lmap" mappings for Insert, Command-line and Lang-Arg
420431
c Command-line
432+
t Terminal-Job
421433

422434
Just before the {rhs} a special character can appear:
423435
* indicates that it is not remappable
@@ -530,9 +542,9 @@ scenario: >
530542
:imap <M-C> foo
531543
:set encoding=utf-8
532544
The mapping for <M-C> is defined with the latin1 encoding, resulting in a 0xc3
533-
byte. If you type the character á (0xe1 <M-a>) in UTF-8 encoding this is the
545+
byte. If you type the character á (0xe1 <M-a>) in UTF-8 encoding this is the
534546
two bytes 0xc3 0xa1. You don't want the 0xc3 byte to be mapped then or
535-
otherwise it would be impossible to type the á character.
547+
otherwise it would be impossible to type the á character.
536548

537549
*<Leader>* *mapleader*
538550
To define a mapping which uses the "mapleader" variable, the special string
@@ -682,7 +694,7 @@ option). After that it assumes that the 'q' is to be interpreted as such. If
682694
you type slowly, or your system is slow, reset the 'timeout' option. Then you
683695
might want to set the 'ttimeout' option.
684696

685-
*map-precedence*
697+
*map-precedence*
686698
Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
687699
global mappings. When a buffer-local mapping is the same as a global mapping,
688700
Vim will use the buffer-local mapping. In addition, Vim will use a complete
@@ -798,7 +810,7 @@ Bear in mind that convert-meta has been reported to have troubles when used in
798810
UTF-8 locales. On terminals like xterm, the "metaSendsEscape" resource can be
799811
toggled on the fly through the "Main Options" menu, by pressing Ctrl-LeftClick
800812
on the terminal; that's a good last resource in case you want to send ESC when
801-
using other applications but not when inside VIM.
813+
using other applications but not when inside Vim.
802814

803815

804816
1.11 MAPPING AN OPERATOR *:map-operator*
@@ -905,7 +917,9 @@ an additional rule:
905917
full-id In front of the match is a non-keyword character, or this is where
906918
the line or insertion starts. Exception: When the abbreviation is
907919
only one character, it is not recognized if there is a non-keyword
908-
character in front of it, other than a space or a tab.
920+
character in front of it, other than a space or a tab. However, for
921+
the command line "'<,'>" (or any other marks) is ignored, as if the
922+
command line starts after it.
909923

910924
end-id In front of the match is a keyword character, or a space or a tab,
911925
or this is where the line or insertion starts.
@@ -1260,6 +1274,7 @@ By default, the arguments of user defined commands do not undergo completion.
12601274
However, by specifying one or the other of the following attributes, argument
12611275
completion can be enabled:
12621276

1277+
-complete=arglist file names in argument list
12631278
-complete=augroup autocmd groups
12641279
-complete=buffer buffer names
12651280
-complete=behave :behave suboptions
@@ -1279,6 +1294,7 @@ completion can be enabled:
12791294
-complete=highlight highlight groups
12801295
-complete=history :history suboptions
12811296
-complete=locale locale names (as output of locale -a)
1297+
-complete=mapclear buffer argument
12821298
-complete=mapping mapping name
12831299
-complete=menu menus
12841300
-complete=messages |:messages| suboptions
@@ -1414,6 +1430,8 @@ The valid escape sequences are
14141430
<line1> The starting line of the command range.
14151431
*<line2>*
14161432
<line2> The final line of the command range.
1433+
*<range>*
1434+
<range> The number of items in the command range: 0, 1 or 2
14171435
*<count>*
14181436
<count> Any count supplied (as described for the '-range'
14191437
and '-count' attributes).

0 commit comments

Comments
 (0)