Skip to content

Commit 0245850

Browse files
authored
Merge pull request #1074 from tsuyoshicho/update/20220410/change
Update change.{txt,jax}
2 parents e6289b9 + eec7943 commit 0245850

File tree

2 files changed

+90
-30
lines changed

2 files changed

+90
-30
lines changed

doc/change.jax

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*change.txt* For Vim バージョン 8.2. Last change: 2021 Mar 01
1+
*change.txt* For Vim バージョン 8.2. Last change: 2022 Mar 05
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -247,6 +247,8 @@ Vimが "cw" を単語の変更(change-word)として解釈し、また「単語
247247
{range} なしの場合、現在行のみを変更する。
248248
[!]をつけると、このコマンドを実行するときだけ
249249
'autoindent' をトグルする。
250+
このコマンドは変数名ととても混同しやすいため、|Vim9|
251+
script ではサポートされない。
250252

251253
==============================================================================
252254
3. 単純な変更 *simple-change*
@@ -753,16 +755,18 @@ NOTE パターンに 'magic' が適用されるかどうかを変更するフラ
753755
:%s/TESTING
754756
これは、全行から "TESTING" を削除する例である。ただし、1つの行に2個以上あって
755757
も1個しか削除されない。
756-
757-
Viとの互換性のため、これら2つの例外が許される
758+
*E1270*
759+
旧来のスクリプトでは、Viとの互換性のため、これら2つの例外が許される:
758760
"\/{string}/" と "\?{string}?" は "//{string}/r" と同様の効果。
759761
"\&{string}&" は "//{string}/" と同様の効果。
760-
*pattern-delimiter* *E146*
761-
'/' でパターンと置換文字列を囲む代わりに、英数字や '\', '"', '|' 以外であれば、
762-
他の1バイト文字を使うことができる。これは検索パターンや置換文字列に '/' を含む
763-
場合に有益である。例 >
762+
*pattern-delimiter* *E146* *E1241* *E1242*
763+
'/' でパターンと置換文字列を囲む代わりに、他の1バイト文字を使うことができる。
764+
これは検索パターンや置換文字列に '/' を含む場合に有益である。例 >
764765
:s+/+//+
765766
767+
英数字でないものや、 '\', '"', '|' 以外の多くの文字が使える。Vim9 script では
768+
'#' はコメントの開始を識別するものなので使用しないこと。
769+
766770
パターンの定義については |pattern| を参照。矩形ビジュアルモードで、置換をその
767771
領域内だけで行いたい場合は、パターンに |/\%V| を含める。これを使わない場合は、
768772
置換は常に行全体に対して行われる。
@@ -911,7 +915,7 @@ NOTE: 以前のバージョンでは CTRL-V が特別に扱われていた。こ
911915
い。
912916

913917
例: >
914-
:s@\n@\="\r" . expand("$HOME") . "\r"@
918+
:s@\n@\="\r" .. expand("$HOME") . "\r"@
915919
こうすると置換を行った行の下に、環境変数 $HOME の値を含む新しい行が挿入される。
916920
>
917921
s/E/\="\<Char-0x20ac>"/g
@@ -1013,6 +1017,11 @@ NOTE: 以前のバージョンでは CTRL-V が特別に扱われていた。こ
10131017
でコピーしたいときは (この方が論理的と言えるが、Vi互換
10141018
ではない) ":map Y y$" を使う。
10151019

1020+
*zy*
1021+
["x]zy{motion} {motion} のテキストを [レジスタ x に] コピーする。`y`
1022+
との唯一の差はテキストの選択がブロックの時にある、
1023+
|v_zy| を参照。
1024+
10161025
*v_y*
10171026
{Visual}["x]y ビジュアル選択されたテキストを [レジスタ x に] コピー
10181027
する
@@ -1022,6 +1031,12 @@ NOTE: 以前のバージョンでは CTRL-V が特別に扱われていた。こ
10221031
{Visual}["x]Y ビジュアル選択された行を [レジスタ x に] コピーする
10231032
({Visual} については |Visual-mode| を参照)。
10241033

1034+
*v_zy*
1035+
{Visual}["x]zy ビジュアル選択されたテキストを [レジスタ x に] コピー
1036+
する。選択したブロックの各行の末尾の空白はコピーされな
1037+
い。`zp` との組み合せが特に便利である。({Visual} につ
1038+
いては |Visual-mode| を参照)。
1039+
10251040
*:y* *:yank* *E850*
10261041
:[range]y[ank] [x] [range] の行を [レジスタ x に] コピーする。"* レジスタ
10271042
と "+ レジスタへのコピーは |+clipboard| 機能が有効な場
@@ -1031,7 +1046,7 @@ NOTE: 以前のバージョンでは CTRL-V が特別に扱われていた。こ
10311046
[range] の最後の行 (省略時は現在行 |cmdline-ranges|)
10321047
から数えて {count} 行を [レジスタ x に] コピーする。
10331048

1034-
*p* *put* *E353*
1049+
*p* *put* *E353* *E1240*
10351050
["x]p カーソルの後に、テキストを [count]回 [レジスタ x から]
10361051
貼り付ける。
10371052

@@ -1076,7 +1091,7 @@ NOTE: 以前のバージョンでは CTRL-V が特別に扱われていた。こ
10761091
がコマンドの末尾として解釈されないようにするには、それ
10771092
らをエスケープする {訳注: 前に '\' を置く} 必要がある。
10781093
例: >
1079-
:put ='path' . \",/test\"
1094+
:put ='path' .. \",/test\"
10801095
< '=' の後に式がないときは前回の式が使われる。それはコマ
10811096
ンド ":dis =" で見ることができる。
10821097

@@ -1095,6 +1110,11 @@ NOTE: 以前のバージョンでは CTRL-V が特別に扱われていた。こ
10951110
る。マウスは、'mouse' が 'n' か 'a' を含むときだけ使え
10961111
る。
10971112

1113+
["x]zp または *zp* *zP*
1114+
["x]zP "p" と "P" に似ているが、ブロックのペースト時に末尾の
1115+
空白は追加しない。そして挿入されるテキストは矩形にはな
1116+
らない。|v_zy| との組み合せが特に便利である。
1117+
10981118
これらのコマンドを使って、ある場所から別の場所へテキストをコピーできる。まずコ
10991119
ピー、削除または変更コマンドを使って、テキストをレジスタに蓄える。そしてレジス
11001120
タの内容を、貼り付けコマンドで文章中に挿入する。これらのコマンドで、あるファイ
@@ -1121,10 +1141,12 @@ NOTE: 以前のバージョンでは CTRL-V が特別に扱われていた。こ
11211141
サイズと、選択領域の角が既存の文字上にあるかどうかにもよる。(実装上の詳細:実際
11221142
の動作は、まずレジスタの中身を選択領域の後に貼り付け、その後で選択領域を削除す
11231143
るようになっている)
1124-
それまで選択されていたテキストが無名レジスタに保存される。同じテキストを複数の
1125-
ビジュアル選択領域にプットしたい場合は、ほかのレジスタを使う必要がある。例え
1126-
ば、コピーしたいテキストをヤンクして、選択したテキストを "0p で置き換える。こ
1127-
れを好きなだけ繰り返す。このとき、無名レジスタはプットするたびに変わる。
1144+
'p' だとそれまで選択されていたテキストが無名レジスタに保存される。これは選択テ
1145+
キストを別の場所にプットするのに便利である。しかし、同じ変更を繰り返せない。
1146+
'P' だと無名レジスタは変更されず、同じ変更を繰り返すことができる。しかし削除さ
1147+
れたテキストは使えない。そうしたいなら 'p' をほかのレジスタで使う必要がある。
1148+
例えば、コピーしたいテキストをヤンクして、選択したテキストを "0p で置き換える。
1149+
これを好きなだけ繰り返し、そして無名レジスタはプットするたびに変わる。
11281150

11291151
矩形ビジュアルモードで一行のみをヤンクしたとき、それをビジュアル選択した範囲に
11301152
貼り付けると、選択範囲にその一行が貼り付けされる (つまり貼り付けた行のブロック
@@ -1139,6 +1161,9 @@ Vimは、このようにするために <Tab> を空白で置き換えること
11391161
ストのブロックの幅が <Tab> の幅の整数倍でなく、さらに挿入されたブロックの後の
11401162
テキストが <Tab> を含むとき、列揃えがおかしくなることがある。
11411163

1164+
|zP|/|zp|を使用して、末尾にスペースを追加せずにブロック単位でヤンクされたレジ
1165+
スタを貼り付ける。
1166+
11421167
Note 文字単位のコピーコマンドの後、コピーされたテキストの中でバッファの先頭に
11431168
一番近い文字の上にカーソルが置かれることに注意。つまり "yl" ではカーソルは動か
11441169
ないが、"yh" ではカーソルは1文字左に動く。
@@ -1311,6 +1336,8 @@ Note 関数から抜けると、この値は関数に入る前の値に復元さ
13111336

13121337
*:t*
13131338
:t ":copy" と同義。
1339+
このコマンドは変数名ととても混同しやすいため、|Vim9|
1340+
script ではサポートされない。
13141341

13151342
:[range]m[ove] {address} *:m* *:mo* *:move* *E134*
13161343
[range] 行を、{address} 行目の下に移動する。
@@ -1596,7 +1623,8 @@ r 挿入モードで <Enter> を打ち込んだ後に、現在のコメント開
15961623
挿入する。
15971624
*fo-o*
15981625
o ノーマルモードで 'o', 'O' を打ち込んだ後に、現在のコメント開始文字列を
1599-
自動的に挿入する。
1626+
自動的に挿入する。特定の場所でコメントが不要な場合は、CTRL-U を使用し
1627+
て素早く削除する。|i_CTRL-U|
16001628
*fo-q*
16011629
q "gq" でコメントを整形する。
16021630
NOTE 整形は空行やコメント開始文字列のみの行は変更しないことに注意。新

en/change.txt

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*change.txt* For Vim version 8.2. Last change: 2021 Mar 01
1+
*change.txt* For Vim version 8.2. Last change: 2022 Mar 05
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -259,6 +259,9 @@ Or use "caw" (see |aw|).
259259
line.
260260
Adding [!] toggles 'autoindent' for the time this
261261
command is executed.
262+
This command is not supported in |Vim9| script,
263+
because it is too easily confused with a variable
264+
name.
262265

263266
==============================================================================
264267
3. Simple changes *simple-change*
@@ -775,17 +778,20 @@ matched pattern is deleted. The separator after {pattern} can also be left
775778
out then. Example: >
776779
:%s/TESTING
777780
This deletes "TESTING" from all lines, but only one per line.
778-
779-
For compatibility with Vi these two exceptions are allowed:
781+
*E1270*
782+
For compatibility with Vi these two exceptions are allowed in legacy script:
780783
"\/{string}/" and "\?{string}?" do the same as "//{string}/r".
781784
"\&{string}&" does the same as "//{string}/".
782-
*pattern-delimiter* *E146*
783-
Instead of the '/' which surrounds the pattern and replacement string, you
784-
can use any other single-byte character, but not an alphanumeric character,
785-
'\', '"' or '|'. This is useful if you want to include a '/' in the search
786-
pattern or replacement string. Example: >
785+
*pattern-delimiter* *E146* *E1241* *E1242*
786+
Instead of the '/' which surrounds the pattern and replacement string, you can
787+
use another single-byte character. This is useful if you want to include a
788+
'/' in the search pattern or replacement string. Example: >
787789
:s+/+//+
788790
791+
You can use most characters, but not an alphanumeric character, '\', '"' or
792+
'|'. In Vim9 script you should not use '#' because it may be recognized as
793+
the start of a comment.
794+
789795
For the definition of a pattern, see |pattern|. In Visual block mode, use
790796
|/\%V| in the pattern to have the substitute work in the block only.
791797
Otherwise it works on whole lines anyway.
@@ -940,7 +946,7 @@ Consider using a character like "@" or ":". There is no problem if the result
940946
of the expression contains the separation character.
941947

942948
Examples: >
943-
:s@\n@\="\r" . expand("$HOME") . "\r"@
949+
:s@\n@\="\r" .. expand("$HOME") .. "\r"@
944950
This replaces an end-of-line with a new line containing the value of $HOME. >
945951
946952
s/E/\="\<Char-0x20ac>"/g
@@ -1042,6 +1048,10 @@ inside of strings can change! Also see 'softtabstop' option. >
10421048
cursor to the end of line (which is more logical,
10431049
but not Vi-compatible) use ":map Y y$".
10441050

1051+
*zy*
1052+
["x]zy{motion} Yank {motion} text [into register x]. Only differs
1053+
from `y` when selecting a block of text, see |v_zy|.
1054+
10451055
*v_y*
10461056
{Visual}["x]y Yank the highlighted text [into register x] (for
10471057
{Visual} see |Visual-mode|).
@@ -1050,6 +1060,12 @@ inside of strings can change! Also see 'softtabstop' option. >
10501060
{Visual}["x]Y Yank the highlighted lines [into register x] (for
10511061
{Visual} see |Visual-mode|).
10521062

1063+
*v_zy*
1064+
{Visual}["x]zy Yank the highlighted text [into register x]. Trailing
1065+
whitespace at the end of each line of a selected block
1066+
won't be yanked. Especially useful in combination
1067+
with `zp`. (for {Visual} see |Visual-mode|)
1068+
10531069
*:y* *:yank* *E850*
10541070
:[range]y[ank] [x] Yank [range] lines [into register x]. Yanking to the
10551071
"* or "+ registers is possible only when the
@@ -1060,7 +1076,7 @@ inside of strings can change! Also see 'softtabstop' option. >
10601076
in [range] (default: current line |cmdline-ranges|),
10611077
[into register x].
10621078

1063-
*p* *put* *E353*
1079+
*p* *put* *E353* *E1240*
10641080
["x]p Put the text [from register x] after the cursor
10651081
[count] times.
10661082

@@ -1107,7 +1123,7 @@ inside of strings can change! Also see 'softtabstop' option. >
11071123
the command. You need to escape the '|' and '"'
11081124
characters to prevent them from terminating the
11091125
command. Example: >
1110-
:put ='path' . \",/test\"
1126+
:put ='path' .. \",/test\"
11111127
< If there is no expression after '=', Vim uses the
11121128
previous expression. You can see it with ":dis =".
11131129

@@ -1126,6 +1142,12 @@ inside of strings can change! Also see 'softtabstop' option. >
11261142
Using the mouse only works when 'mouse' contains 'n'
11271143
or 'a'.
11281144

1145+
["x]zp or *zp* *zP*
1146+
["x]zP Like "p" and "P", except without adding trailing spaces
1147+
when pasting a block. Thus the inserted text will not
1148+
always be a rectangle. Especially useful in
1149+
combination with |v_zy|.
1150+
11291151
You can use these commands to copy text from one place to another. Do this
11301152
by first getting the text into a register with a yank, delete or change
11311153
command, then inserting the register contents with a put command. You can
@@ -1154,10 +1176,13 @@ register. With blockwise selection it also depends on the size of the block
11541176
and whether the corners are on an existing character. (Implementation detail:
11551177
it actually works by first putting the register after the selection and then
11561178
deleting the selection.)
1157-
The previously selected text is put in the unnamed register. If you want to
1158-
put the same text into a Visual selection several times you need to use
1179+
With 'p' the previously selected text is put in the unnamed register. This is
1180+
useful if you want to put that text somewhere else. But you cannot repeat the
1181+
same change.
1182+
With 'P' the unnamed register is not changed, you can repeat the same change.
1183+
But the deleted text cannot be used. If you do need it you can use 'p' with
11591184
another register. E.g., yank the text to copy, Visually select the text to
1160-
replace and use "0p . You can repeat this as many times as you like, the
1185+
replace and use "0p . You can repeat this as many times as you like, and the
11611186
unnamed register will be changed each time.
11621187

11631188
When you use a blockwise Visual mode command and yank only a single line into
@@ -1175,6 +1200,9 @@ this happen. However, if the width of the block is not a multiple of a <Tab>
11751200
width and the text after the inserted block contains <Tab>s, that text may be
11761201
misaligned.
11771202

1203+
Use |zP|/|zp| to paste a blockwise yanked register without appending trailing
1204+
spaces.
1205+
11781206
Note that after a characterwise yank command, Vim leaves the cursor on the
11791207
first yanked character that is closest to the start of the buffer. This means
11801208
that "yl" doesn't move the cursor, but "yh" moves the cursor one character
@@ -1352,6 +1380,9 @@ The next three commands always work on whole lines.
13521380

13531381
*:t*
13541382
:t Synonym for copy.
1383+
This command is not supported in |Vim9| script,
1384+
because it is too easily confused with a variable
1385+
name.
13551386

13561387
:[range]m[ove] {address} *:m* *:mo* *:move* *E134*
13571388
Move the lines given by [range] to below the line
@@ -1649,7 +1680,8 @@ r Automatically insert the current comment leader after hitting
16491680
<Enter> in Insert mode.
16501681
*fo-o*
16511682
o Automatically insert the current comment leader after hitting 'o' or
1652-
'O' in Normal mode.
1683+
'O' in Normal mode. In case comment is unwanted in a specific place
1684+
use CTRL-U to quickly delete it. |i_CTRL-U|
16531685
*fo-q*
16541686
q Allow formatting of comments with "gq".
16551687
Note that formatting will not change blank lines or lines containing

0 commit comments

Comments
 (0)