Skip to content

Commit 04e87ff

Browse files
committed
Update editing from Vim 8.0 to 8.1
1 parent dbe5ef3 commit 04e87ff

File tree

2 files changed

+43
-32
lines changed

2 files changed

+43
-32
lines changed

doc/editing.jax

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*editing.txt* For Vim バージョン 8.0. Last change: 2017 Aug 21
1+
*editing.txt* For Vim バージョン 8.1. Last change: 2018 Mar 29
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -419,6 +419,14 @@ Note "/inc" とマッチする必要がないため、"/sys" を含むパスが
419419
Unix などではファイル名の引数にバッククォート '`' も使える。例: >
420420
:next `find . -name ver\\*.c -print`
421421
:view `ls -t *.patch \| head -n1`
422+
Vim はバッククォート内のコマンドをシェルで実行し、その標準出力を Vim コマンド
423+
の引数とする。(シェルからのエラーメッセージは破棄される。)
424+
Vim が何のシェルコマンドを実行しているか確認するためには、'verbose' オプション
425+
に 4 を設定する。シェルコマンドが 0 以外の終了コードを返した場合、エラーメッ
426+
セージが表示され Vim コマンドは中断される。これを防ぐためには、次のようにして
427+
シェルが常に 0 を返すようにする。 >
428+
:next `find . -name ver\\*.c -print \|\| true`
429+
422430
アスタリスク '*' の前の '\' は、シェルが find を実行する前に "ver*.c" を展開し
423431
てしまうのを防ぐために必要となる。シェルのパイプ記号 "|" の前のバックスラッシ
424432
ュは Vim がコマンドの終わりとしてパースするのを防ぐ。
@@ -640,8 +648,7 @@ Vim の開始時に複数のファイル名を与えると、それらは引数
640648
重複検査はないので、1個のファイルを引数リストに2回加え
641649
ることもできる。
642650
現在編集中のファイルは変更されない。
643-
{Vi にはない} {Vimが |+listcmds| 機能付きでコンパイル
644-
されたときのみ有効}
651+
{Vi にはない}
645652
Note 次の方法が使えることに注意。 >
646653
:args ## x
647654
< これは項目 "x" を追加し、新たなリストを並び替える。
@@ -655,8 +662,7 @@ Vim の開始時に複数のファイル名を与えると、それらは引数
655662
されたときでも、それをそのままに保つ。
656663
例: >
657664
:argdel *.obj
658-
< {Vi にはない} {Vimが |+listcmds| 機能付きでコンパイル
659-
されたときのみ有効}
665+
< {Vi にはない}
660666

661667
:[range]argd[elete] 引数リストから {range} の範囲のファイルを削除する。
662668
例: >
@@ -671,8 +677,7 @@ Vim の開始時に複数のファイル名を与えると、それらは引数
671677
< 引数リストから全てのファイルを削除する。
672678
範囲の上限が大きすぎるときは、最後の引数までが削除され
673679
る。
674-
{Vi にはない} {Vimが |+listcmds| 機能付きでコンパイル
675-
されたときのみ有効}
680+
{Vi にはない}
676681

677682
*:argu* *:argument*
678683
:[count]argu[ment] [count] [++opt] [+cmd]
@@ -681,16 +686,14 @@ Vim の開始時に複数のファイル名を与えると、それらは引数
681686
Vimがカレントバッファを放棄 |abandon| したくないときに
682687
は失敗する。
683688
|++opt||+cmd| も参照。
684-
{Vi にはない} {Vimが |+listcmds| 機能付きでコンパイル
685-
されたときのみ有効}
689+
{Vi にはない}
686690

687691
:[count]argu[ment]! [count] [++opt] [+cmd]
688692
引数リスト内で [count] 番目のファイルを編集する。カレ
689693
ントバッファに対するいかなる変更も失われる。[count]
690694
省かれると現在の項目を編集する。
691695
|++opt||+cmd| も参照。
692-
{Vi にはない} {Vimが |+listcmds| 機能付きでコンパイル
693-
されたときのみ有効}
696+
{Vi にはない}
694697

695698
:[count]n[ext] [++opt] [+cmd] *:n* *:ne* *:next* *E165* *E163*
696699
引数リストの中で [count] 個次のファイルを編集する。
@@ -817,7 +820,6 @@ Unix およびその他いくつかのシステムではバッククォートも
817820
ローカルな引数リスト
818821

819822
{Vi にはない}
820-
{Vimが |+windows| 機能と |+listcmds| 機能付きでコンパイルされたときのみ有効}
821823

822824
*:arglocal*
823825
:argl[ocal] グローバルな引数リストのローカルなコピーを作る。
@@ -870,8 +872,7 @@ Unix およびその他いくつかのシステムではバッククォートも
870872
でオートコマンドのイベント Syntax を指定することでそれ
871873
を無効化できる。こうすると各ファイルの処理がかなり高速
872874
になる。
873-
{Vi にはない} {Vimが |+listcmds| 機能付きでコンパイル
874-
されたときのみ有効}
875+
{Vi にはない}
875876
|:windo||:tabdo||:bufdo||:cdo||:ldo||:cfdo|
876877
|:lfdo|も参照。
877878

@@ -896,7 +897,7 @@ Note: オプション 'write' がオフのときは、どのファイルも書
896897

897898
*:w* *:write*
898899
*E502* *E503* *E504* *E505*
899-
*E512* *E514* *E667* *E796*
900+
*E512* *E514* *E667* *E796* *E949*
900901
:w[rite] [++opt] バッファ全体をカレントファイルに書き込む。これはファイ
901902
ルに対する変更点を保存するときの普通の方法である。
902903
オプション 'readonly' がオンであるかファイルに書き込め
@@ -947,6 +948,9 @@ Note: オプション 'write' がオフのときは、どのファイルも書
947948
に失敗した後に ":w #" でもう一度試したいときに使える。オプション'cpoptions'
948949
らフラグ 'A' を取り除くとこれを無効化できる。
949950

951+
Note: 書き込みには 'fsync' オプションが関係してくる。設定されている場合には書
952+
き込みがより遅くなるかもしれない。(しかしより安全である。)
953+
950954
*:sav* *:saveas*
951955
:sav[eas][!] [++opt] {file}
952956
カレントファイルをファイル名 {file} として保存し、カレ
@@ -1190,7 +1194,8 @@ ZQ 変更点を確かめずに終了する (コマンド ":q!" と同様)。
11901194
:wqa[ll]! [++opt]
11911195
:xa[ll]! 変更点のあるバッファを、読込専用であっても全て書き込み、Vimを
11921196
終了する。ファイル名のないバッファや何らかの理由で書き込めない
1193-
バッファがあるときは、Vimを終了しない。 {Vi にはない}
1197+
バッファ、またはジョブが実行中の端末があるときは、Vimを終了し
1198+
ない。 {Vi にはない}
11941199

11951200
==============================================================================
11961201
6. ダイアログ *edit-dialogs*

en/editing.txt

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*editing.txt* For Vim version 8.0. Last change: 2017 Aug 21
1+
*editing.txt* For Vim version 8.1. Last change: 2018 Mar 29
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -424,6 +424,15 @@ On Unix and a few other systems you can also use backticks for the file name
424424
argument, for example: >
425425
:next `find . -name ver\\*.c -print`
426426
:view `ls -t *.patch \| head -n1`
427+
Vim will run the command in backticks using the 'shell' and use the standard
428+
output as argument for the given Vim command (error messages from the shell
429+
command will be discarded).
430+
To see what shell command Vim is running, set the 'verbose' option to 4. When
431+
the shell command returns a non-zero exit code, an error message will be
432+
displayed and the Vim command will be aborted. To avoid this make the shell
433+
always return zero like so: >
434+
:next `find . -name ver\\*.c -print \|\| true`
435+
427436
The backslashes before the star are required to prevent the shell from
428437
expanding "ver*.c" prior to execution of the find program. The backslash
429438
before the shell pipe symbol "|" prevents Vim from parsing it as command
@@ -650,8 +659,7 @@ list of the current window.
650659
There is no check for duplicates, it is possible to
651660
add a file to the argument list twice.
652661
The currently edited file is not changed.
653-
{not in Vi} {not available when compiled without the
654-
|+listcmds| feature}
662+
{not in Vi}
655663
Note: you can also use this method: >
656664
:args ## x
657665
< This will add the "x" item and sort the new list.
@@ -665,8 +673,7 @@ list of the current window.
665673
when it's deleted from the argument list.
666674
Example: >
667675
:argdel *.obj
668-
< {not in Vi} {not available when compiled without the
669-
|+listcmds| feature}
676+
< {not in Vi}
670677

671678
:[range]argd[elete] Delete the {range} files from the argument list.
672679
Example: >
@@ -681,8 +688,7 @@ list of the current window.
681688
< Removes all the files from the arglist.
682689
When the last number in the range is too high, up to
683690
the last argument is deleted.
684-
{not in Vi} {not available when compiled without the
685-
|+listcmds| feature}
691+
{not in Vi}
686692

687693
*:argu* *:argument*
688694
:[count]argu[ment] [count] [++opt] [+cmd]
@@ -691,16 +697,14 @@ list of the current window.
691697
when changes have been made and Vim does not want to
692698
|abandon| the current buffer.
693699
Also see |++opt| and |+cmd|.
694-
{not in Vi} {not available when compiled without the
695-
|+listcmds| feature}
700+
{not in Vi}
696701

697702
:[count]argu[ment]! [count] [++opt] [+cmd]
698703
Edit file [count] in the argument list, discard any
699704
changes to the current buffer. When [count] is
700705
omitted the current entry is used.
701706
Also see |++opt| and |+cmd|.
702-
{not in Vi} {not available when compiled without the
703-
|+listcmds| feature}
707+
{not in Vi}
704708

705709
:[count]n[ext] [++opt] [+cmd] *:n* *:ne* *:next* *E165* *E163*
706710
Edit [count] next file. This fails when changes have
@@ -823,7 +827,6 @@ fourth file in the argument list. This happens when you do ":e file".
823827
LOCAL ARGUMENT LIST
824828

825829
{not in Vi}
826-
{not available when compiled without the |+windows| or |+listcmds| features}
827830

828831
*:arglocal*
829832
:argl[ocal] Make a local copy of the global argument list.
@@ -875,8 +878,7 @@ USING THE ARGUMENT LIST
875878
autocommand event is disabled by adding it to
876879
'eventignore'. This considerably speeds up editing
877880
each file.
878-
{not in Vi} {not available when compiled without the
879-
|+listcmds| feature}
881+
{not in Vi}
880882
Also see |:windo|, |:tabdo|, |:bufdo|, |:cdo|, |:ldo|,
881883
|:cfdo| and |:lfdo|
882884

@@ -900,7 +902,7 @@ Note: When the 'write' option is off, you are not able to write any file.
900902

901903
*:w* *:write*
902904
*E502* *E503* *E504* *E505*
903-
*E512* *E514* *E667* *E796*
905+
*E512* *E514* *E667* *E796* *E949*
904906
:w[rite] [++opt] Write the whole buffer to the current file. This is
905907
the normal way to save changes to a file. It fails
906908
when the 'readonly' option is set or when there is
@@ -956,6 +958,9 @@ used, for example, when the write fails and you want to try again later with
956958
":w #". This can be switched off by removing the 'A' flag from the
957959
'cpoptions' option.
958960

961+
Note that the 'fsync' option matters here. If it's set it may make writes
962+
slower (but safer).
963+
959964
*:sav* *:saveas*
960965
:sav[eas][!] [++opt] {file}
961966
Save the current buffer under the name {file} and set
@@ -1199,7 +1204,8 @@ MULTIPLE WINDOWS AND BUFFERS *window-exit*
11991204
:wqa[ll]! [++opt]
12001205
:xa[ll]! Write all changed buffers, even the ones that are readonly,
12011206
and exit Vim. If there are buffers without a file name or
1202-
which cannot be written for another reason, Vim will not quit.
1207+
which cannot be written for another reason, or there is a
1208+
terminal with a running job, Vim will not quit.
12031209
{not in Vi}
12041210

12051211
==============================================================================

0 commit comments

Comments
 (0)