Skip to content

Commit e1068e2

Browse files
authored
Merge pull request #316 from vim-jp/misc_update1
Misc update1
2 parents 3d242f3 + 411a130 commit e1068e2

File tree

12 files changed

+118
-51
lines changed

12 files changed

+118
-51
lines changed

doc/autocmd.jax

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,10 @@ OptionSet オプションが設定された後。パターンは長い(短縮
856856
ットするのは、プラグインの挙動を破壊するため、
857857
良くない。この自動コマンドの実行は `:noa` を使
858858
うことで抑制することができる。
859+
860+
自動コマンド内で |:set| を使用しても、イベント
861+
は再びトリガーされない。
862+
859863
*QuickFixCmdPre*
860864
QuickFixCmdPre QuickFixコマンドが実行される前 (|:make|,
861865
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,

doc/change.jax

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ gR 仮想置換モードに入る。打ち込んだ文字が画面上の既存
166166
一回で置き換えることができる。入力されたテキストを
167167
[count]-1 回繰り返す。詳細は |Virtual-Replace-mode|
168168
参照。
169-
{Vimが |+vreplace| 機能付きでコンパイルされたときのみ
170-
有効}
171169

172170
*c*
173171
["x]c{motion} {motion} のテキストを [レジスタ x に入れ] 削除し、挿入
@@ -289,8 +287,6 @@ gr{char} カーソル下の仮想文字を {char} に置き換える。この
289287
置き換える。詳細は |gR||Virtual-Replace-mode| を参
290288
照。|r| と同様、回数を指定できる。
291289
{char} の入力方法は |r| と同様である。
292-
{Vimが |+vreplace| 機能付きでコンパイルされたときのみ
293-
有効}
294290

295291
*digraph-arg*
296292
|r||t| 等のノーマルモードコマンドの引数は、1個の文字である。オプション
@@ -693,6 +689,7 @@ g& `:%s//~/&` と同義 (全ての行に対し、最後の検索パターン
693689
とリセットする。
694690
{Vi にはないもの: マッチの強調表示、'y' と 'n' 以外の応答}
695691

692+
*:s_e*
696693
[e] 検索パターンが何もマッチしなかったとき、エラーメッセージを表示しない。
697694
特にマッピング内ではエラーが発生しなかったかのように続行される。これは
698695
「パターンは見つかりませんでした」のエラーによるマッピングの中断を防ぐ
@@ -704,33 +701,37 @@ g& `:%s//~/&` と同義 (全ての行に対し、最後の検索パターン
704701
「(割込まれました)」
705702
{Vi にはない}
706703

704+
*:s_g*
707705
[g] 行中の全てのマッチを置換する。このフラグなしだと、各行の1個目のマッチ
708706
のみが置換される。オプション 'edcompatible' がオンのとき、Vimはこのフ
709707
ラグを記憶し、指定される度にオン/オフを切り替えるが、新しい検索パター
710708
ンが使われるとリセットする。'gdefault' がオンのときは、このフラグはオ
711709
ンが既定値になり、フラグ [g] を指定したときにはオフになる。
712710

711+
*:s_i*
713712
[i] パターンの大文字/小文字の区別をしない。オプション 'ignorecase'
714713
'smartcase' は使われない。
715714
{Vi にはない}
716715

716+
*:s_I*
717717
[I] パターンの大文字/小文字を区別する。オプション 'ignorecase'
718718
'smartcase' は使われない。
719719
{Vi にはない}
720720

721+
*:s_n*
721722
[n] マッチの個数を表示し、実際には置換を行わない。フラグ [c] は無視される。
722723
'report' が 0 のときと同じようにマッチが表示される。
723724
何個あるか調べるときに便利。|count-items|
724725
\= |sub-replace-expression| が使われたときは、式はそれぞれのマッチに対
725726
してサンドボックス (|sandbox|) で実行される。
726727

727-
[p] 最後に置換を行った行を表示する。
728-
{Vi にはない}
728+
[p] 最後に置換を行った行を表示する。 *:s_p*
729729

730-
[#] [p] と同様。行番号をつける。
730+
[#] [p] と同様。行番号をつける。 *:s_#*
731731

732-
[l] [p] と同様だが、|:list| のように表示する。
732+
[l] [p] と同様だが、|:list| のように表示する。 *:s_l*
733733

734+
*:s_r*
734735
[r] 引数のない `:&``:s` との連携でのみ有効。`:&r``:~` と同様に動作
735736
する。検索パターンが空のとき、最後の置換コマンドや `:global` でのパター
736737
ンではなく、最後の検索パターンを使用する。最後に検索パターンを使用した
@@ -1445,7 +1446,7 @@ autoload ディレクトリに置くこと。例、~/.vim/autoload/format.vim: >
14451446
14461447
その後以下のように整形を有効にすることができる: >
14471448
setlocal formatexpr=format#Format()
1448-
>
1449+
14491450
Note: この関数は、挿入モードから呼ばれた場合に明示的に非ゼロを返す (基本的に
14501451
'textwidth' の制限を超えてテキストが挿入されることを意味する)。これは Vim に内
14511452
部の整形機能に立ち戻って再整形させることになる。

doc/channel.jax

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ send を呼ぶたびに毎回コールバックを指定する代わりに、チ
162162
"auto" メッセージを処理するコールバックがない場合。
163163
"close_cb" もこのために考慮されます。
164164
"never" すべてのメッセージが保存されます。
165+
166+
*channel-noblock*
167+
"noblock" |job-noblock| と同じ効果です。書込みの為だけの事項です。
168+
165169
*waittime*
166170
"waittime" 接続がミリ秒単位で待機する時間。負の数は永遠に待ちます。
167171

@@ -596,6 +600,19 @@ job_setoptions(job, {options}) を使用して、ジョブの開始後にいく
596600
Note: ファイルやバッファに書き込むときやバッファから読
597601
み込むときは、NL モードがデフォルトで使用されます。
598602

603+
*job-noblock*
604+
"noblock": 1 書き込み時に、非ブロッキング書き込み呼び出しを使用しま
605+
す。これは Vim が間に他のメッセージを処理する必要があ
606+
る場合に止まるのを回避します。例えば、ジョブが Vim に
607+
データを返すとき。これは、`ch_sendraw()` が返されたと
608+
きに、すべてのデータがまだ書き込まれていない可能性があ
609+
ることを意味します。
610+
このオプションはパッチ 8.1.0350 で追加され、以下を使っ
611+
て検査します: >
612+
if has("patch-8.1.350")
613+
let options['noblock'] = 1
614+
endif
615+
<
599616
*job-callback*
600617
"callback": handler チャネルの任意の部分で何かを読むためのコールバック。
601618
*job-out_cb* *out_cb*

doc/cmdline.jax

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -792,11 +792,12 @@ Note: "#<n" 以外は、ユーザーに打ち込まれた通りのファイル
792792
\\# \#
793793
|`=| も参照のこと。
794794

795-
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
796-
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
797-
*:<abuf>* *<abuf>* *:<amatch>* *<amatch>*
798-
*:<cexpr>* *<cexpr>*
799-
*<slnum>* *E495* *E496* *E497* *E499* *E500*
795+
*:<cword>* *<cword>* *:<cWORD>* *<cWORD>*
796+
*:<cexpr>* *<cexpr>* *:<cfile>* *<cfile>*
797+
*:<afile>* *<afile>* *:<abuf>* *<abuf>*
798+
*:<amatch>* *<amatch>*
799+
*:<sfile>* *<sfile>* *:<slnum>* *<slnum>*
800+
*:<sflnum>* *<sflnum>* *E499* *E500*
800801
Note: これらは文字通りに打ち込まれる、これらは特別なキーではない!
801802
<cword> カーソル下の word に置き換えられる (|star| と同様)
802803
<cWORD> カーソル下の WORD に置き換えられる (|WORD| を参照)
@@ -807,15 +808,16 @@ Note: これらは文字通りに打ち込まれる、これらは特別なキ
807808
|v:beval_text| のために使われる。
808809
<cfile> カーソル下のパス名に置き換えられる (|gf| が使うものと同様)
809810
<afile> 自動コマンドの実行時、操作されているバッファのファイル名ま
810-
たは読み書き用のファイル名に置き換えられる。
811+
たは読み書き用のファイル名に置き換えられる。 *E495*
811812
<abuf> 自動コマンドの実行時、カレントバッファの番号に置き換えられ
812813
る (":r file" と ":so file" のときにもカレントバッファの番
813814
号に置き換えられる。読み込まれているファイルはバッファ内に
814-
ない)
815+
ない) *E496*
815816
<amatch> 自動コマンドの実行時、この自動コマンドが実行されたときのマッ
816-
チに置き換えられる。そのファイル名がマッチの検索に使われて
817-
いないときのみ、<afile> と違う値になる (イベント FileType、
818-
Syntax、SpellFileMissing 用)。
817+
チに置き換えられる。 *E497*
818+
そのファイル名がマッチの検索に使われていないときのみ、
819+
<afile> と違う値になる (イベント FileType, Syntax,
820+
SpellFileMissing 用)。
819821
<sfile> コマンド ":source" の実行時、取り込まれたファイルのファイル
820822
名に置き換えられる。 *E498*
821823
関数の実行時はこのように置き換えられる:
@@ -826,6 +828,9 @@ Note: これらは文字通りに打ち込まれる、これらは特別なキ
826828
は無効になることに注意。
827829
<slnum> コマンド ":source" の実行時、行番号に置き換えられる。 *E842*
828830
関数の中では、関数の先頭からの相対的な行番号になる。
831+
<sflnum> スクリプトを実行すると、行番号に置き換えられる。<slnum>
832+
異なる点は、<sflnum> がどのような状況でもスクリプト行番号で
833+
置き換えられることである。 *E961*
829834

830835
*filename-modifiers*
831836
*:_%:* *::8* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs* *::S*
@@ -849,7 +854,8 @@ Note: これらは文字通りに打ち込まれる、これらは特別なキ
849854
イル名は修正されない。
850855
:. ファイル名をカレントディレクトリについて相対的な名前に (可能な
851856
らば) 切り詰める。ファイル名がカレントディレクトリの下になけれ
852-
ば、ファイル名は修正されない。
857+
ば、ファイル名は修正されない。しかし、MS-Windowsでは、カレント
858+
ドライブであればドライブ名は削除される。
853859
最も短く切り詰めるには ":~:." を使う。
854860
:h ファイル名のヘッド (末尾の部分と全ての区切りが除かれたもの)。
855861
:e, :r, :t には使えない。

doc/diff.jax

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
2つ目以降の引数にはディレクトリ名を指定することもできる。その際には第1引数の
3939
ファイル名がそのディレクトリ名に追加され、ファイルを検索するのに利用される。
4040

41-
これは外部コマンドの "diff" が存在する場合にだけ動作する。'diffexpr' 参照。
41+
デフォルトでは、内部diffライブラリが使用される。'diffopt' または 'diffexpr'
42+
設定されていると外部の "diff" コマンドが使用される。これは、そのようなdiffプロ
43+
グラムが利用可能な場合にのみ機能する。
4244

4345
diff はカレントタブページ |tab-page| にローカルである。他のタブページにある
4446
ウィンドウとの差分を見ることはできない。これによって、複数の差分を同時に見るこ
@@ -340,8 +342,9 @@ g:diff_translations を 0 に設定する: >
340342
341343
">" は 'shellredir' の値に置き換えられる。
342344

343-
"diff" の出力は通常の "ed" 形式の差分でなければならない。コンテキスト差分を使
344-
用してはいけない。この例はVimが求めるフォーマットを示している: >
345+
"diff" の出力は通常の "ed" 形式の差分またはユニファイド差分でなければならない。
346+
コンテキスト差分を使用してはいけない。 この例では、Vimが "ed" 形式の差分に求め
347+
るフォーマットを示している: >
345348
346349
1a2
347350
> bbb
@@ -379,12 +382,16 @@ g:diff_translations を 0 に設定する: >
379382
endif
380383
silent execute "!diff -a --binary " . opt . v:fname_in . " " . v:fname_new .
381384
\ " > " . v:fname_out
385+
redraw!
382386
endfunction
383387
384388
引数の "-a" は強制的にテキストファイルとして比較するために使われる。バイナリで
385389
の比較は使いにくい。引数の "--binary" はファイルをバイナリモードで読み込むため
386390
に使われる。DOSでCTRL-Zをテキストの終わりとしないためである。
387391

392+
シェルコマンドを実行し、ディスプレイに何かが表示されるかどうかによっては、
393+
`redraw!` コマンドは必要ないかもしれない。
394+
388395
*E810* *E97*
389396
Vimは差分の出力結果が妥当であるか検証する。妥当でない場合、エラーメッセージを
390397
得るだろう。起こりうるエラーは:

doc/editing.jax

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,8 @@ Unix およびその他いくつかのシステムではバッククォートも
896896
Note: オプション 'write' がオフのときは、どのファイルも書き込めないことに注意。
897897

898898
*:w* *:write*
899-
*E502* *E503* *E504* *E505*
900-
*E512* *E514* *E667* *E796* *E949*
899+
*E502* *E503* *E504* *E505*
900+
*E512* *E514* *E667* *E796* *E949*
901901
:w[rite] [++opt] バッファ全体をカレントファイルに書き込む。これはファイ
902902
ルに対する変更点を保存するときの普通の方法である。
903903
オプション 'readonly' がオンであるかファイルに書き込め

en/autocmd.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,9 @@ OptionSet After setting an option. The pattern is
864864
plugin. You can always use `:noa` to prevent
865865
triggering this autocommand.
866866

867+
When using |:set| in the autocommand the event
868+
is not triggered again.
869+
867870
*QuickFixCmdPre*
868871
QuickFixCmdPre Before a quickfix command is run (|:make|,
869872
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,

en/change.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ gR Enter Virtual Replace mode: Each character you type
177177
<Tab> may replace several characters at once.
178178
Repeat the entered text [count]-1 times. See
179179
|Virtual-Replace-mode| for more details.
180-
{not available when compiled without the |+vreplace|
181-
feature}
182180

183181
*c*
184182
["x]c{motion} Delete {motion} text [into register x] and start
@@ -303,8 +301,6 @@ gr{char} Replace the virtual characters under the cursor with
303301
space. See |gR| and |Virtual-Replace-mode| for more
304302
details. As with |r| a count may be given.
305303
{char} can be entered like with |r|.
306-
{not available when compiled without the |+vreplace|
307-
feature}
308304

309305
*digraph-arg*
310306
The argument for Normal mode commands like |r| and |t| is a single character.
@@ -712,6 +708,7 @@ The flags that you can use for the substitute commands:
712708
search pattern.
713709
{not in Vi: highlighting of the match, other responses than 'y' or 'n'}
714710

711+
*:s_e*
715712
[e] When the search pattern fails, do not issue an error message and, in
716713
particular, continue in maps as if no error occurred. This is most
717714
useful to prevent the "No match" error from breaking a mapping. Vim
@@ -723,33 +720,38 @@ The flags that you can use for the substitute commands:
723720
Interrupted
724721
{not in Vi}
725722

723+
*:s_g*
726724
[g] Replace all occurrences in the line. Without this argument,
727725
replacement occurs only for the first occurrence in each line. If
728726
the 'edcompatible' option is on, Vim remembers this flag and toggles
729727
it each time you use it, but resets it when you give a new search
730728
pattern. If the 'gdefault' option is on, this flag is on by default
731729
and the [g] argument switches it off.
732730

731+
*:s_i*
733732
[i] Ignore case for the pattern. The 'ignorecase' and 'smartcase' options
734733
are not used.
735734
{not in Vi}
736735

736+
*:s_I*
737737
[I] Don't ignore case for the pattern. The 'ignorecase' and 'smartcase'
738738
options are not used.
739739
{not in Vi}
740740

741+
*:s_n*
741742
[n] Report the number of matches, do not actually substitute. The [c]
742743
flag is ignored. The matches are reported as if 'report' is zero.
743744
Useful to |count-items|.
744745
If \= |sub-replace-expression| is used, the expression will be
745746
evaluated in the |sandbox| at every match.
746747

747-
[p] Print the line containing the last substitute.
748+
[p] Print the line containing the last substitute. *:s_p*
748749

749-
[#] Like [p] and prepend the line number.
750+
[#] Like [p] and prepend the line number. *:s_#*
750751

751-
[l] Like [p] but print the text like |:list|.
752+
[l] Like [p] but print the text like |:list|. *:s_l*
752753

754+
*:s_r*
753755
[r] Only useful in combination with `:&` or `:s` without arguments. `:&r`
754756
works the same way as `:~`: When the search pattern is empty, use the
755757
previously used search pattern instead of the search pattern from the
@@ -1451,7 +1453,7 @@ to the name of an external program for Vim to use for text formatting. The
14511453
program.
14521454

14531455
*format-formatexpr*
1454-
The 'formatexpr' option can be set to a Vim Script function that performs
1456+
The 'formatexpr' option can be set to a Vim script function that performs
14551457
reformatting of the buffer. This should usually happen in an |ftplugin|,
14561458
since formatting is highly dependent on the type of file. It makes
14571459
sense to use an |autoload| script, so the corresponding script is only loaded
@@ -1485,7 +1487,7 @@ text. Put it in your autoload directory, e.g. ~/.vim/autoload/format.vim: >
14851487
14861488
You can then enable the formatting by executing: >
14871489
setlocal formatexpr=format#Format()
1488-
>
1490+
14891491
Note: this function explicitly returns non-zero when called from insert mode
14901492
(which basically means, text is inserted beyond the 'textwidth' limit). This
14911493
causes Vim to fall back to reformat the text by using the internal formatter.

en/channel.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ Use |ch_status()| to see if the channel could be opened.
163163
The "close_cb" is also considered for this.
164164
"never" All messages will be kept.
165165

166+
*channel-noblock*
167+
"noblock" Same effect as |job-noblock|. Only matters for writing.
168+
166169
*waittime*
167170
"waittime" The time to wait for the connection to be made in
168171
milliseconds. A negative number waits forever.
@@ -594,6 +597,17 @@ See |job_setoptions()| and |ch_setoptions()|.
594597
Note: when writing to a file or buffer and when
595598
reading from a buffer NL mode is used by default.
596599

600+
*job-noblock*
601+
"noblock": 1 When writing use a non-blocking write call. This
602+
avoids getting stuck if Vim should handle other
603+
messages in between, e.g. when a job sends back data
604+
to Vim. It implies that when `ch_sendraw()` returns
605+
not all data may have been written yet.
606+
This option was added in patch 8.1.0350, test with: >
607+
if has("patch-8.1.350")
608+
let options['noblock'] = 1
609+
endif
610+
<
597611
*job-callback*
598612
"callback": handler Callback for something to read on any part of the
599613
channel.

0 commit comments

Comments
 (0)