From c3adef187c9e0af5cb9074fbeca9134ae20b72b1 Mon Sep 17 00:00:00 2001 From: h-east Date: Fri, 17 Oct 2025 21:50:41 +0900 Subject: [PATCH] Update undo.{txt,jax} --- doc/undo.jax | 9 +++++---- en/undo.txt | 30 ++++++++++++++++-------------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/doc/undo.jax b/doc/undo.jax index aac68aa4a..998c60839 100644 --- a/doc/undo.jax +++ b/doc/undo.jax @@ -1,4 +1,4 @@ -*undo.txt* For Vim バージョン 9.1. Last change: 2024 Nov 09 +*undo.txt* For Vim バージョン 9.1. Last change: 2025 Oct 12 VIMリファレンスマニュアル by Bram Moolenaar @@ -277,8 +277,8 @@ Note テキストプロパティは undo ファイルには保存されません ":wundo" と ":rundo" を使うことで undo 履歴の保存と復元を手動で実行することも できます。 - *:wundo* *:rundo* -:wundo[!] {file} + *:wu* *:wundo* +:wu[ndo][!] {file} undo 履歴を {file} に保存する。 {file} が存在し、それが undo ファイルでないなら (ファイル先頭 のマジックナンバーが違うなら)、コマンドは失敗します。それでも @@ -290,7 +290,8 @@ Note テキストプロパティは undo ファイルには保存されません 制限のかかったディレクトリ内の undo ファイルは上書きできませ ん。 -:rundo {file} {file} から undo 履歴を読み込む。 + *:rund* *:rundo* +:rund[o] {file} {file} から undo 履歴を読み込む。 自動コマンドを使うことで undo ファイルの名前を明示的に指定することができます。 例: > diff --git a/en/undo.txt b/en/undo.txt index 1d6a481c6..cf674608d 100644 --- a/en/undo.txt +++ b/en/undo.txt @@ -1,4 +1,4 @@ -*undo.txt* For Vim version 9.1. Last change: 2024 Nov 09 +*undo.txt* For Vim version 9.1. Last change: 2025 Oct 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -112,7 +112,7 @@ parts. E.g., for each sentence. |i_CTRL-G_u| Setting the value of 'undolevels' also closes the undo block. Even when the new value is equal to the old value. Use `g:undolevels` to explicitly read -and write only the global value of 'undolevels'. In |Vim9| script: > +and write only the global value of 'undolevels'. In |Vim9| script: > &g:undolevels = &g:undolevels In legacy script: > let &g:undolevels = &g:undolevels @@ -156,7 +156,7 @@ This is explained in the user manual: |usr_32.txt|. MM/DD HH:MM:SS idem, with month and day YYYY/MM/DD HH:MM:SS idem, with year The "saved" column specifies, if this change was - written to disk and which file write it was. This can + written to disk and which file write it was. This can be used with the |:later| and |:earlier| commands. For more details use the |undotree()| function. @@ -256,7 +256,7 @@ for, you can use a BufWritePre autocommand: > au BufWritePre /tmp/* setlocal noundofile Vim saves undo trees in a separate undo file, one for each edited file, using -a simple scheme that maps filesystem paths directly to undo files. Vim will +a simple scheme that maps filesystem paths directly to undo files. Vim will detect if an undo file is no longer synchronized with the file it was written for (with a hash of the file contents) and ignore it when the file was changed after the undo file was written, to prevent corruption. An undo file is also @@ -278,21 +278,22 @@ guaranteed. You can also save and restore undo histories by using ":wundo" and ":rundo" respectively: - *:wundo* *:rundo* -:wundo[!] {file} + *:wu* *:wundo* +:wu[ndo][!] {file} Write undo history to {file}. When {file} exists and it does not look like an undo file (the magic number at the start of the file is wrong), then this fails, unless the ! was added. If it exists and does look like an undo file it is - overwritten. If there is no undo-history, nothing will be + overwritten. If there is no undo-history, nothing will be written. Implementation detail: Overwriting happens by first deleting the existing file and then creating a new file with the same - name. So it is not possible to overwrite an existing undofile + name. So it is not possible to overwrite an existing undofile in a write-protected directory. -:rundo {file} Read undo history from {file}. + *:rund* *:rundo* +:rund[o] {file} Read undo history from {file}. You can use these in autocommands to explicitly specify the name of the history file. E.g.: > @@ -384,11 +385,12 @@ information you can use these commands: > Note use of `&l:undolevels` to explicitly read the local value of 'undolevels' and the use of `:setlocal` to change only the local option (which takes -precedence over the corresponding global option value). Saving the option value -via the use of `&undolevels` is unpredictable; it reads either the local value -(if one has been set) or the global value (otherwise). Also, if a local value -has been set, changing the option via `:set undolevels` will change both the -global and local values, requiring extra work to save and restore both values. +precedence over the corresponding global option value). Saving the option +value via the use of `&undolevels` is unpredictable; it reads either the local +value (if one has been set) or the global value (otherwise). Also, if a local +value has been set, changing the option via `:set undolevels` will change both +the global and local values, requiring extra work to save and restore both +values. Marks for the buffer ('a to 'z) are also saved and restored, together with the text.