From 63771f0ede924a7b9bd55bdb645a7afc5dfece06 Mon Sep 17 00:00:00 2001 From: h-east Date: Mon, 16 Dec 2024 09:37:04 +0900 Subject: [PATCH 1/3] Update change.{txt,jax} --- doc/change.jax | 22 +++++++++++----------- en/change.txt | 17 ++++++++--------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/doc/change.jax b/doc/change.jax index 1e5085c1f..15885c428 100644 --- a/doc/change.jax +++ b/doc/change.jax @@ -1,4 +1,4 @@ -*change.txt* For Vim バージョン 9.1. Last change: 2024 Nov 12 +*change.txt* For Vim バージョン 9.1. Last change: 2024 Dec 15 VIMリファレンスマニュアル by Bram Moolenaar @@ -1468,18 +1468,18 @@ gww "gw" と同様にして現在行を整形する。 れ、かつそのスクリプト名は format.vim とされるべきなので、|autoload| スクリプトを使用することは理にかなっている。 -例えば、Vim と共に配布され $VIMRUNTIME ディレクトリに配置されている XML ファイ -ルタイププラグインは、オプション 'formatexpr' を以下のように設定する: > +例えば、Vim と共に配布され $VIMRUNTIME/ftplugin ディレクトリに配置されている +XML ファイルタイププラグインは、オプション 'formatexpr' を以下のように設定する: +> setlocal formatexpr=xmlformat#Format() -これは、xmlformat#Format() を定義している対応したスクリプトが以下のディレクト -リで見つかることを意味している: -`$VIMRUNTIME/autoload/xmlformat.vim` +これは、xmlformat#Format() を定義している対応したスクリプトがファイル +`$VIMRUNTIME/autoload/xmlformat.vim` で見つかることを意味している: 以下は、選択されたテキストから末尾の空白を取り除くスクリプトの例である。これを -autoload ディレクトリに置くこと。例、~/.vim/autoload/format.vim: > - +autoload ディレクトリに置くこと。例、~/.vim/autoload/format.vim: +>vim func! format#Format() " 明示的な gq コマンドの場合だけ再整形する if mode() != 'n' @@ -1512,8 +1512,8 @@ Note: この関数は、挿入モードから呼ばれた場合に明示的に *right-justify* テキストを右揃えするコマンドは、Vimには存在しない。"par" 等の外部コマンド (例: -"!}par" で段落の最後までを整形する) を実行したり、'formatprg' に "par" を指定 -することで、これを行うことができる。 +`:.,}!par` で段落の最後までを整形する) を実行したり、'formatprg' に "par" を指 +定することで、これを行うことができる。 *format-comments* コメント整形の概要がユーザーマニュアルの |30.6| にある。 @@ -1575,7 +1575,7 @@ Vimは特殊な方法で自動的にコメントを挿入・整形できる。Vi べきインデントが存在しているときのみ機能する。 コメント文字列にフラグ 'f', 's', 'm', 'e' のいずれも指定しないとき、Vimはコメ -ント文字列を行の最初に繰り返すと仮定する。フラグ欄は空になる。 +ント文字列を行の最初に繰り返すと仮定する。{flags} 欄は空になる。 {string} の前や後にある余白は、{string} の一部とされる。コメント文字列に必要で ない限り、余白を前や後に付けないこと。 diff --git a/en/change.txt b/en/change.txt index e4366551d..301eacee2 100644 --- a/en/change.txt +++ b/en/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 9.1. Last change: 2024 Nov 12 +*change.txt* For Vim version 9.1. Last change: 2024 Dec 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1512,18 +1512,17 @@ since formatting is highly dependent on the type of file. It makes sense to use an |autoload| script, so the corresponding script is only loaded when actually needed and the script should be called format.vim. -For example, the XML filetype plugin distributed with Vim in the $VIMRUNTIME -directory, sets the 'formatexpr' option to: > +For example, the XML filetype plugin distributed with Vim in the +$VIMRUNTIME/ftplugin directory, sets the 'formatexpr' option to: > setlocal formatexpr=xmlformat#Format() That means, you will find the corresponding script, defining the -xmlformat#Format() function, in the directory: -`$VIMRUNTIME/autoload/xmlformat.vim` +xmlformat#Format() function, in the file `$VIMRUNTIME/autoload/xmlformat.vim` Here is an example script that removes trailing whitespace from the selected -text. Put it in your autoload directory, e.g. ~/.vim/autoload/format.vim: > - +text. Put it in your autoload directory, e.g. ~/.vim/autoload/format.vim: +>vim func! format#Format() " only reformat on explicit gq command if mode() != 'n' @@ -1556,7 +1555,7 @@ debugging it helps to set the 'debug' option. *right-justify* There is no command in Vim to right justify text. You can do it with -an external command, like "par" (e.g.: "!}par" to format until the end of the +an external command, like "par" (e.g.: `:.,}!par` to format until the end of the paragraph) or set 'formatprg' to "par". *format-comments* @@ -1622,7 +1621,7 @@ type of comment string. A part consists of: some indent for the start or end part that can be removed. When a string has none of the 'f', 's', 'm' or 'e' flags, Vim assumes the -comment string repeats at the start of each line. The flags field may be +comment string repeats at the start of each line. The {flags} field may be empty. Any blank space in the text before and after the {string} is part of the From 777d38ba7288449f60f090bc4d74f09e874621ef Mon Sep 17 00:00:00 2001 From: h-east Date: Fri, 20 Dec 2024 05:26:21 +0900 Subject: [PATCH 2/3] tweak --- doc/change.jax | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/change.jax b/doc/change.jax index 15885c428..0eb2b5c2e 100644 --- a/doc/change.jax +++ b/doc/change.jax @@ -1471,7 +1471,6 @@ gww "gw" と同様にして現在行を整形する。 例えば、Vim と共に配布され $VIMRUNTIME/ftplugin ディレクトリに配置されている XML ファイルタイププラグインは、オプション 'formatexpr' を以下のように設定する: > - setlocal formatexpr=xmlformat#Format() これは、xmlformat#Format() を定義している対応したスクリプトがファイル From 3a20c4f960c79b5c12ac980ded4ed6db9ae10390 Mon Sep 17 00:00:00 2001 From: h_east Date: Sun, 22 Dec 2024 14:36:11 +0900 Subject: [PATCH 3/3] Update doc/change.jax Co-authored-by: Tsuyoshi CHO --- doc/change.jax | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/change.jax b/doc/change.jax index 0eb2b5c2e..d972bb842 100644 --- a/doc/change.jax +++ b/doc/change.jax @@ -1474,7 +1474,7 @@ XML ファイルタイププラグインは、オプション 'formatexpr' を setlocal formatexpr=xmlformat#Format() これは、xmlformat#Format() を定義している対応したスクリプトがファイル -`$VIMRUNTIME/autoload/xmlformat.vim` で見つかることを意味している: +`$VIMRUNTIME/autoload/xmlformat.vim` で見つかることを意味している。 以下は、選択されたテキストから末尾の空白を取り除くスクリプトの例である。これを autoload ディレクトリに置くこと。例、~/.vim/autoload/format.vim: