Skip to content

Commit c915c7c

Browse files
authored
Merge pull request #1307 from vim-jp/hh-update-editing
Update editing.{txt,jax}
2 parents e712369 + e14b352 commit c915c7c

File tree

2 files changed

+105
-10
lines changed

2 files changed

+105
-10
lines changed

doc/editing.jax

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*editing.txt* For Vim バージョン 9.0. Last change: 2022 Apr 16
1+
*editing.txt* For Vim バージョン 9.0. Last change: 2023 Sep 27
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -383,7 +383,9 @@ MS-Windowsでは '\' がパスの区切り文字なので、オプション 'isf
383383
"path[abc]" を編集できる。
384384

385385
*starstar-wildcard*
386-
"**" の展開は、Unix, Win32, macOS、その他数種類のシステムでのみ使用できる。
386+
"**" の展開は、Unix, Win32, macOS、その他数種類のシステムでのみ使用できる (た
387+
だし、'shell' 設定に依存する可能性がある。zsh では正しく動作することが知られて
388+
いる。bash では、少なくとも bash バージョン 4.X 以上が必要である)。
387389
"**" はディレクトリツリーを再帰的に検索する。深さの上限は100ディレクトリである。
388390
Note: いくつかのコマンドでは、この挙動が少し異なる。|file-searching| を参照。
389391
例: >
@@ -570,6 +572,43 @@ DOS 形式でファイルを読み込んで、Unix 形式でそれを保存す
570572
れは他人がユーザーのファイルを読むことに対して、ある程度の安全を保証する。
571573
|encryption|
572574

575+
☆行末とファイル終端 *eol-and-eof*
576+
577+
Vim には、ファイル形式を制御するためのいくつかのオプションがある:
578+
'fileformat' <EOL> 形式: Unix, DOS, Mac
579+
'endofline' 最後の行が <EOL> で終わるかどうか
580+
'endoffile' ファイルが CTRL-Z で終わるかどうか
581+
'fixendofline' eol と eof を修正するかどうか
582+
583+
最初の 3 つの値は通常、ファイルの読み取り時に自動的に検出され、テキストをファ
584+
イルに書き込むときに使用される。バッファを編集していると、すべての行に行末があ
585+
り、CTRL-Z がないように見える ('binary' が設定されている場合は例外で、その場合
586+
は動作が異なる)。
587+
588+
'fixendofline' オプションを使用して、書き込む内容を選択できる。オプションの値
589+
を変更して、読み取り時とは異なる方法でファイルを書き込むこともできる。
590+
591+
これらの使用例をいくつか示す。
592+
593+
Unix 形式のファイルが必要な場合 (すべての行が NL で終了する): >
594+
setl ff=unix fixeol
595+
おそらく、Unix ライクなシステムであれば、どんなシステムでもこれを行うべきであ
596+
る。また、最近の MS-Windows システムでもうまく動作する傾向がある。Vim script
597+
には常にこのフォーマットを使うことをお勧めする。
598+
599+
古い MS-DOS ファイルを最新の環境で使用する場合は、行末を修正して CTRL-Z を削除
600+
するが、<CR><NL> スタイルの <EOL> は維持する: >
601+
setl ff=dos fixeol
602+
これは多くの MS-Windows プログラムにとって便利で、これらは通常 <CR><NL> 行末を
603+
期待する。
604+
605+
最後の <EOL> を削除し、最後の CTRL-Z を追加したい場合(例えば CP/M のような古
606+
いシステム向け): >
607+
setl ff=dos nofixeol noeol eof
608+
609+
最後の <EOL> と最後の CTRL-Z を含め、ファイル形式をそのまま保持したい場合: >
610+
setl nofixeol
611+
573612
==============================================================================
574613
3. 引数リスト *argument-list* *arglist*
575614

@@ -1053,6 +1092,13 @@ Vimはファイルを書き込むときにACL情報を保とうとする。バ
10531092
ACL情報は (ファイルを開くときに) ファイルが読込専用かどうか調べるのにも使われ
10541093
る。
10551094

1095+
*xattr* *E1506* *E1507* *E1508* *E1509*
1096+
xattr は Extended Attributes の略で、ファイルシステム内のファイルと一緒にメタ
1097+
データを保存する高度な方法である。これは使用されている実際のファイルシステムに
1098+
依存し、Vim は Linux システムでのみサポートしている。
1099+
Vim はファイルの書き込み時に拡張属性情報を保存しようとする。バックアップファ
1100+
イルは、元のファイルの拡張属性を取得する。
1101+
10561102
*read-only-share*
10571103
MS-Windowsがネットワーク上でドライブを共有するとき、そこは読込専用にすることが
10581104
できる。つまりファイルに読込専用の属性がなく、NCネットワーク共有ドライブ上の
@@ -1480,9 +1526,11 @@ Note: メモリ内のテキストは暗号化されない。ユーザーがテ
14801526
14811527
'cryptmethod' オプションを設定することで暗号化メソッドを選択できる。次の中から
14821528
選択できる: >
1483-
:setlocal cm=zip " 弱いメソッド。後方互換。
1484-
:setlocal cm=blowfish " 脆弱性ありのメソッド
1485-
:setlocal cm=blowfish2 " 中強度のメソッド
1529+
:setlocal cm=zip " 弱いメソッド。後方互換。
1530+
:setlocal cm=blowfish " 脆弱性ありのメソッド。使用禁止。
1531+
:setlocal cm=blowfish2 " 中強度のメソッド
1532+
:setlocal cm=xchacha20v2 " libsodium を使用した中強度のメソッド
1533+
14861534
ファイルを保存する前に設定する。暗号化されたファイルを読み込んだとき、このオプ
14871535
ションは自動的にファイル保存時に使われたメソッドに設定される。ファイルを保存す
14881536
る前に 'cryptmethod' を変更することで使用するメソッドを変更できる。

en/editing.txt

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*editing.txt* For Vim version 9.0. Last change: 2022 Apr 16
1+
*editing.txt* For Vim version 9.0. Last change: 2023 Sep 27
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -385,7 +385,9 @@ as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
385385
is to use "path\[[]abc]", this matches the file "path\[abc]".
386386

387387
*starstar-wildcard*
388-
Expanding "**" is possible on Unix, Win32, macOS and a few other systems.
388+
Expanding "**" is possible on Unix, Win32, macOS and a few other systems (but
389+
it may depend on your 'shell' setting. It's known to work correctly for zsh; for
390+
bash this requires at least bash version >= 4.X).
389391
This allows searching a directory tree. This goes up to 100 directories deep.
390392
Note there are some commands where this works slightly differently, see
391393
|file-searching|.
@@ -578,6 +580,43 @@ single <NL> characters are unexpectedly replaced with <CR><NL>.
578580
You can encrypt files that are written by setting the 'key' option. This
579581
provides some security against others reading your files. |encryption|
580582

583+
END OF LINE AND END OF FILE *eol-and-eof*
584+
585+
Vim has several options to control the file format:
586+
'fileformat' the <EOL> style: Unix, DOS, Mac
587+
'endofline' whether the last line ends with a <EOL>
588+
'endoffile' whether the file ends with a CTRL-Z
589+
'fixendofline' whether to fix eol and eof
590+
591+
The first three values are normally detected automatically when reading the
592+
file and are used when writing the text to a file. While editing the buffer
593+
it looks like every line has a line ending and the CTRL-Z isn't there (an
594+
exception is when 'binary' is set, it works differently then).
595+
596+
The 'fixendofline' option can be used to choose what to write. You can also
597+
change the option values to write the file differently than how it was read.
598+
599+
Here are some examples how to use them.
600+
601+
If you want files in Unix format (every line NL terminated): >
602+
setl ff=unix fixeol
603+
You should probably do this on any Unix-like system. Also modern MS-Windows
604+
systems tend to work well with this. It is recommended to always use this
605+
format for Vim scripts.
606+
607+
If you want to use an old MS-DOS file in a modern environment, fixing line
608+
endings and dropping CTRL-Z, but keeping the <CR><NL> style <EOL>: >
609+
setl ff=dos fixeol
610+
This is useful for many MS-Windows programs, they regularly expect the
611+
<CR><NL> line endings.
612+
613+
If you want to drop the final <EOL> and add a final CTRL-Z (e.g. for an old
614+
system like CP/M): >
615+
setl ff=dos nofixeol noeol eof
616+
617+
If you want to preserve the fileformat exactly as-is, including any final
618+
<EOL> and final CTRL-Z: >
619+
setl nofixeol
581620
582621
==============================================================================
583622
3. The argument list *argument-list* *arglist*
@@ -1058,6 +1097,13 @@ will get the ACL info of the original file.
10581097
The ACL info is also used to check if a file is read-only (when opening the
10591098
file).
10601099

1100+
*xattr* *E1506* *E1507* *E1508* *E1509*
1101+
xattr stands for Extended Attributes It is an advanced way to save metadata
1102+
alongside the file in the filesystem. It depends on the actual filesystem
1103+
being used and Vim supports it only on a Linux system.
1104+
Vim attempts to preserve the extended attribute info when writing a file.
1105+
The backup file will get the extended attribute of the original file.
1106+
10611107
*read-only-share*
10621108
When MS-Windows shares a drive on the network it can be marked as read-only.
10631109
This means that even if the file read-only attribute is absent, and the ACL
@@ -1496,9 +1542,10 @@ To disable the encryption, reset the 'key' option to an empty value: >
14961542
14971543
You can use the 'cryptmethod' option to select the type of encryption, use one
14981544
of these: >
1499-
:setlocal cm=zip " weak method, backwards compatible
1500-
:setlocal cm=blowfish " method with flaws
1501-
:setlocal cm=blowfish2 " medium strong method
1545+
:setlocal cm=zip " weak method, backwards compatible
1546+
:setlocal cm=blowfish " method with flaws, do not use
1547+
:setlocal cm=blowfish2 " medium strong method
1548+
:setlocal cm=xchacha20v2 " medium strong method using libsodium
15021549
15031550
Do this before writing the file. When reading an encrypted file it will be
15041551
set automatically to the method used when that file was written. You can

0 commit comments

Comments
 (0)