|
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 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | 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
|
385 | 385 | is to use "path\[[]abc]", this matches the file "path\[abc]".
|
386 | 386 |
|
387 | 387 | *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). |
389 | 391 | This allows searching a directory tree. This goes up to 100 directories deep.
|
390 | 392 | Note there are some commands where this works slightly differently, see
|
391 | 393 | |file-searching|.
|
@@ -578,6 +580,43 @@ single <NL> characters are unexpectedly replaced with <CR><NL>.
|
578 | 580 | You can encrypt files that are written by setting the 'key' option. This
|
579 | 581 | provides some security against others reading your files. |encryption|
|
580 | 582 |
|
| 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 |
581 | 620 |
|
582 | 621 | ==============================================================================
|
583 | 622 | 3. The argument list *argument-list* *arglist*
|
@@ -1058,6 +1097,13 @@ will get the ACL info of the original file.
|
1058 | 1097 | The ACL info is also used to check if a file is read-only (when opening the
|
1059 | 1098 | file).
|
1060 | 1099 |
|
| 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 | + |
1061 | 1107 | *read-only-share*
|
1062 | 1108 | When MS-Windows shares a drive on the network it can be marked as read-only.
|
1063 | 1109 | 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: >
|
1496 | 1542 |
|
1497 | 1543 | You can use the 'cryptmethod' option to select the type of encryption, use one
|
1498 | 1544 | 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 |
1502 | 1549 |
|
1503 | 1550 | Do this before writing the file. When reading an encrypted file it will be
|
1504 | 1551 | set automatically to the method used when that file was written. You can
|
|
0 commit comments