diff --git a/doc/cmdline.jax b/doc/cmdline.jax index ceee0f214..04ccd6c06 100644 --- a/doc/cmdline.jax +++ b/doc/cmdline.jax @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim バージョン 8.2. Last change: 2020 Apr 23 +*cmdline.txt* For Vim バージョン 8.2. Last change: 2020 Aug 09 VIMリファレンスマニュアル by Bram Moolenaar @@ -838,7 +838,7 @@ Note: "#* ** *:* ** *:* ** *:* ** *:* ** *:* ** - *:* ** + *:* ** *:* ** *:* ** *:* ** *:* ** *E499* *E500* Note: これらは文字通りに打ち込まれる、これらは特別なキーではない! @@ -863,12 +863,14 @@ Note: これらは文字通りに打ち込まれる、これらは特別なキ SpellFileMissing 用)。 コマンド ":source" の実行時、取り込まれたファイルのファイル 名に置き換えられる。 *E498* - 関数の実行時はこのように置き換えられる: - "function {関数名}[{行番号}]" - 関数呼び出しのネスト (入れ子状態) はこのように表される: + 関数の実行時は、 と同様にコールスタックに置き換えら + れる(これは後方互換性のためであり、 を使うのが望しい) + Note: スクリプト内で が使われていない場合、ファイル + 名修飾子は無効になることに注意。 + コールスタックに置き換えられ、"function {関数名}[{行番号}]" + が関数行としてまた "script {ファイル名}[{行番号}]" がスクリ + プト行として、そして要素間は ".." が使われる。例: "function {関数名1}[{行番号}]..{関数名2}[{行番号}]" - Note 関数内で が使われている場合、ファイル名修飾子 - は無効になることに注意。 コマンド ":source" の実行時、行番号に置き換えられる。 *E842* 関数の中では、関数の先頭からの相対的な行番号になる。 スクリプトを実行すると、行番号に置き換えられる。 と @@ -1079,7 +1081,8 @@ CTRL-C コマンドラインモードとして継続する。カーソル下の が引き継がれる。挿入モードとノーマルモードの両方で有効である。 再描画は行われないので、ウィンドウは可視状態のままになる。 :quit コマンドラインを破棄してノーマルモードに戻る。 - ":close", ":exit", ":xit" や CTRL-\ CTRL-N も有効である。 + ":close", CTRL-W c, ":exit", ":xit" や CTRL-\ CTRL-N も有効で + ある。 :qall Vimを終了する (他のバッファに変更がない限り)。 :qall! Vimを終了し、どのバッファの変更も破棄する。 diff --git a/doc/helphelp.jax b/doc/helphelp.jax index 2976baf10..f98408b21 100644 --- a/doc/helphelp.jax +++ b/doc/helphelp.jax @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim バージョン 8.2. Last change: 2020 Mar 01 +*helphelp.txt* For Vim バージョン 8.2. Last change: 2020 Jul 27 VIMリファレンスマニュアル by Bram Moolenaar @@ -366,14 +366,16 @@ Vim ヘルプファイルでは以下のものがそれぞれハイライトさ 詳細は $VIMRUNTIME/syntax/help.vim を見てください。 *inclusion* -一部の人々は、ユーザーに言及するときに "his" を使うことに大騒ぎし、我々がユー -ザーを男性であると仮定しているかのように考えています。もちろんそういう意図では -ありません、ヘルプテキストを書く際の習慣になっているだけで、多くの場合、何年も -昔からそう書かれてます。また、多くの文章は、英語が第一言語{訳注: 母語のこと} -ではない貢献者によって書かれています。私たちはテキストの言い回しなどに関係な -く、ユーザーのジェンダーがどうなのか仮定することはありません。そのような相談に -時間を無駄にしたくありません。目標は、読者が Vim がどのように動くかの仕組みを -理解することで、正しい言葉遣いは二の次です。 +Vim はみんなのもので、人種、性別、その他何も関係しません。一部の人々は、ユー +ザーに言及するときに "he" や "his" を使うことに大騒ぎし、我々がユーザーを男性 +であると仮定しているかのように考えています。もちろんそういう意図ではありませ +ん、ヘルプテキストを書く際の習慣になっているだけで、多くの場合、何年も昔からそ +う書かれてます。また、多くの文章は、英語が第一言語{訳注: 母語のこと} ではない +貢献者によって書かれています。私たちはテキストの言い回しなどに関係なく、ユー +ザーのジェンダーがどうなのか仮定することはありません。そのような相談をする人達 +は "they" を使うようにと提案しますが、しかしそれは通常の英語ではありません。そ +のような相談に多くの時間を費やしたくありません。目標は、読者が Vim がどのよう +に動くかの仕組みを理解することで、正しい言葉遣いは二の次です。 vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/doc/map.jax b/doc/map.jax index 733932abf..5430c2ea3 100644 --- a/doc/map.jax +++ b/doc/map.jax @@ -1,4 +1,4 @@ -*map.txt* For Vim バージョン 8.2. Last change: 2020 Apr 23 +*map.txt* For Vim バージョン 8.2. Last change: 2020 Sep 06 VIMリファレンスマニュアル by Bram Moolenaar @@ -188,6 +188,12 @@ 引数に を追加します。そしてそのマップは一致する場合に使用され、Vimは それ以上入力される文字を待ちません。しかし、既に文字が入力されていた場合はそれ が使われます。 +Note: これが動作するのは なマッピングが完全にマッチし、なんらかの部分 +マッチの前に見付かるときです。これが動作するのは: +- バッファローカルなマッピングで唯一のマッチがあるとき。なぜなら常にグローバル + なマッピングより先に見付かるからです。 +- これとは別のバッファローカルなマッピングが部分マッチするが、より早く定義され + ているとき (最後に定義したマッピングが最初に見付かる)。 *:map-* *:map-silent* 実行するコマンドがコマンドラインに表示されないようにするには、マップコマンドの @@ -275,16 +281,8 @@ getchar() によって取得され、返されます。 CTRL-L で次の番号を挿入し、CTRL-R で番号をリセットします。CTRL-R は空文字列を 返すので、何も挿入されません。 -Note: 特殊キーが機能するようにしたり、テキスト中の CSI バイトをエスケープした -りするために、特別な処理が行われています。|:map| コマンドも同様の処理を行うの -で、それが二重に実行されるのを防ぐ必要があります。次のものは機能しません: > - :imap "" -なぜなら、 で使われるときにもう一度エスケー -プされるからです。次のものは機能します: > - :imap "\u611B" -テキストの末尾以外で 0x80 をシングルバイトとして使った場合、それは機能しませ -ん。特殊キーとして認識されます。 +Note: テキストの末尾以外で 0x80 をシングルバイトとして使った場合、それは機能し +ません。特殊キーとして認識されます。 1.3 マップとモード *:map-modes* @@ -864,34 +862,46 @@ g@{motion} 'operatorfunc' に設定された関数を実行します。 例を示します。これは を使ってスペースの数を数えます: > - nmap :set opfunc=CountSpacesg@ - vmap :call CountSpaces(visualmode(), 1) + nnoremap CountSpaces() + xnoremap CountSpaces() + " 2回で行に作用 + nnoremap CountSpaces() .. '_' - function! CountSpaces(type, ...) - let sel_save = &selection - let &selection = "inclusive" - let reg_save = @@ - - if a:0 " ビジュアルモードから呼び出すのに、gv コマンドを使用します。 - silent exe "normal! gvy" - elseif a:type == 'line' - silent exe "normal! '[V']y" - else - silent exe "normal! `[v`]y" + function CountSpaces(type = '') abort + if a:type == '' + set opfunc=CountSpaces + return 'g@' endif - echomsg strlen(substitute(@@, '[^ ]', '', 'g')) - - let &selection = sel_save - let @@ = reg_save + let sel_save = &selection + let reg_save = getreginfo('"') + let cb_save = &clipboard + let visual_marks_save = [getpos("'<"), getpos("'>")] + + try + set clipboard= selection=inclusive + let commands = #{line: "'[V']y", char: "`[v`]y", block: "`[\`]y"} + silent exe 'noautocmd keepjumps normal! ' .. get(commands, a:type, '') + echom getreg('"')->count(' ') + finally + call setreg('"', reg_save) + call setpos("'<", visual_marks_save[0]) + call setpos("'>", visual_marks_save[1]) + let &clipboard = cb_save + let &selection = sel_save + endtry endfunction + のマッピングを使うことでなんらかのカウントかレジスタの接頭詞を取ること +が可能になります。それにより、CmdlineEnter と CmdlineLeave の自動コマンドをト +リガーするコマンドラインの使用も回避します。 + Note: 一時的に 'selection' を "inclusive" に設定し、'[ から '] まで選択した範 囲を正しくヤンクできるようにしています。 -Note: ビジュアルモードのために別のマップを定義しています。ビジュアルモードで -":" を押した場合に挿入される "'<,'>" を削除し、関数に visualmode() の値と追加 -の引数を渡しています。 +Note: 'clipboard' オプションの値に `unnamed` か `unnamedplus` が含まれている場 +合、レジスタの `"*` や `"+` が上書きされることを防ぐため、一時的に空に設定され +ます。 ============================================================================== 2. 短縮入力 (Abbreviations) *abbreviations* *Abbreviations* @@ -1152,6 +1162,10 @@ non-id マッチした場所の前がスペース、タブ、行頭、挿入 行されます。そのコマンドからローカル関数を呼び出したり、ローカルマップを使用す ることができます。 + が正しく展開されないコンテキストで値が使われる場合は、expand() 関数を使 +います: > + let &includexpr = expand('') .. 'My_includeexpr()' + スクリプト以外の場所で "" を使うとエラーになります。 複雑な処理をするスクリプトで、スクリプト番号が必要な場合は、次の関数で番号を得 diff --git a/doc/mlang.jax b/doc/mlang.jax index 6573c8015..48ad3432b 100644 --- a/doc/mlang.jax +++ b/doc/mlang.jax @@ -1,4 +1,4 @@ -*mlang.txt* For Vim バージョン 8.2. Last change: 2019 May 05 +*mlang.txt* For Vim バージョン 8.2. Last change: 2020 Aug 15 VIMリファレンスマニュアル by Bram Moolenaar @@ -38,6 +38,7 @@ Vimはシステム環境からロケール(地域情報)を判定する。ほと :lan[guage] mes[sages] :lan[guage] cty[pe] :lan[guage] tim[e] +:lan[guage] col[late] 現在の言語(言い換えればロケール)を表示する。 引数 "message" を使用するとメッセージに利用されている 言語が表示される。専門的には: LC_MESSAGES @@ -45,15 +46,18 @@ Vimはシステム環境からロケール(地域情報)を判定する。ほと る言語が表示される。専門的には: LC_CTYPE 引数 "time" を使用するとstrftime()が表示に利用する言語 が表示される。専門的には: LC_TIME + 引数 "collate" を使用すると照合に利用する言語が表示さ + れる。専門的には: LC_COLLATE 無引数ならばロケールの全体が表示される(どのように表示 されるかはシステムに依存する)。 - 現在の言語は|v:lang|, |v:ctype| そして |v:lc_time|の各 - 変数で取得することもできる。 + 現在の言語は|v:lang|, |v:ctype|, |v:collate| そして + |v:lc_time| の各変数で取得することもできる。 :lan[guage] {name} :lan[guage] mes[sages] {name} :lan[guage] cty[pe] {name} :lan[guage] tim[e] {name} +:lan[guage] col[late] {name} 現在の言語(言い換えればロケール)を{name}に設定する。 {name}というロケールがシステムに存在していなければなら ない。あるシステムでは "en" とか "en_US" と言った別称 @@ -72,7 +76,10 @@ Vimはシステム環境からロケール(地域情報)を判定する。ほと 引数 "time" を使用すると時刻と日付のメッセージに利用さ れる言語を設定する。strftime()に影響を与える。これは $LC_TIME を設定する。 - 無引数ならば両方が設定され、加えて $LANG が設定される。 + 引数 "collate" を使用すると照合に利用される言語を設定 + する。照合順に影響を与える。これは $LC_COLLATE を設定 + する。 + 無引数ならば全てが設定され、加えて $LANG が設定される。 |+float| 機能付きでコンパイルされている場合は、常に LC_NUMERIC が "C" にセットされ、浮動小数点数が小数点と して '.' を使うようになる。 diff --git a/doc/options.jax b/doc/options.jax index ba642fa17..d0f400541 100644 --- a/doc/options.jax +++ b/doc/options.jax @@ -1,4 +1,4 @@ -*options.txt* For Vim バージョン 8.2. Last change: 2020 Jun 10 +*options.txt* For Vim バージョン 8.2. Last change: 2020 Sep 06 VIMリファレンスマニュアル by Bram Moolenaar @@ -737,6 +737,8 @@ Note 1番目の形式では、行全体がオプション指定に使われる "double" は 'listchars' や 'fillchars' に指定された文字が全角幅になっ てしまう場合は使えない。 + この値は |setcellwidths()| で指定された文字では無視される。 + これらの文字のグリフの幅を、旧い/伝統的なCJKエンコーディングで何オク テットを占めるかだけによって決めているCJKフォントがたくさんある。その エンコーディングではユーロ、登録商標記号、ギリシャ文字、キリル文字は2 @@ -759,11 +761,11 @@ Note 1番目の形式では、行全体がオプション指定に使われる *'antialias'* *'anti'* *'noantialias'* *'noanti'* 'antialias' 'anti' 切替 (既定ではオフ) グローバル - {VimがMac OS XでGUIを有効にしてコンパイルされたときの - み有効} - このオプションはMac OS X v10.2以降の上でGUI版のVimを使うときだけ効果が - ある。これがオンであるとなめらかな(アンチエイリアスされた)フォントが使 - われる。このフォントはある種のディスプレイ上、あるサイズでは読み易くな + {VimがmacOSでGUIを有効にしてコンパイルされたときのみ有 + 効} + このオプションはmacOS v10.2以降の上でGUI版のVimを使うときだけ効果があ + る。これがオンであるとなめらかな(アンチエイリアスされた)フォントが使わ + れる。このフォントはある種のディスプレイ上、あるサイズでは読み易くな る。 'guifont' が既定値(空文字列)のときこのオプションを設定すると問題が発生 することがある。 @@ -1996,9 +1998,12 @@ Note 1番目の形式では、行全体がオプション指定に使われる {|+textprop| または |+quickfix| 機能付きでコンパイルさ れたときのみ有効} 'completeopt' に "popup" が含まれている場合、このオプションは、作成時 - に情報ポップアップのプロパティに使用される。また、|popup_findinfo()| - を使用して、|popup_setoptions()| で既存の情報ポップアップのプロパティ - を設定することもできる。|complete-popup| を参照。 + に情報ポップアップのプロパティに使用される。すでに情報ポップアップウィ + ンドウが有る場合は閉じられ、再生成されるときにオプションの値が適用され + る。 + また、|popup_findinfo()| を使用して、|popup_setoptions()| で既存の情報 + ポップアップのプロパティを設定することもできる。|complete-popup| を参 + 照。 *'concealcursor'* *'cocu'* @@ -2728,10 +2733,15 @@ Note 1番目の形式では、行全体がオプション指定に使われる Unixでの既定値: ".,~/tmp,/var/tmp,/tmp") グローバル スワップファイル用ディレクトリの、コンマ区切りのリスト。 + 推奨値: ".,~/vimswap//" - これは可能な場合は編集したファイルの隣にス + ワップファイルが置かれ、そうでないならあなたの個人スワップディレクトリ + に置かれる。"~/vimswap//" はあなただけが読み込み可能にしておくこと。 + + 可能な項目: - スワップファイルは、リスト内の利用できるディレクトリのうち、最初のディ レクトリの中に作られる。 - - 値が空だとスワップファイルは作られず(回復は不可能になる!)、|E303| エ - ラーは発生しない。 + - 値が空だとスワップファイルは作られず (回復は不可能になる!)、|E303| + エラーは発生しない。 - ディレクトリに "." を指定すると、編集されているファイルと同じディレ クトリにスワップファイルが作られる。Unixではファイル名の先頭にドット が追加されるので、ディレクトリ内のファイル一覧には表示されない。 @@ -2741,11 +2751,11 @@ Note 1番目の形式では、行全体がオプション指定に使われる れているファイルからの相対的な位置にスワップファイルが作られる。先頭 の "." は編集されているファイルのパス名に置換される。 - UnixとWin32では、指定されたディレクトリ名の末尾がディレクトリの区切 - り記号2個("//")で終わっていたら、スワップファイルの名前はフルパスに - 従って付けられる。スワップファイルのファイル名をフルパス形式で表し、 - ディレクトリの区切り文字をパーセント記号 '%' で置き換えたものが使わ - れる。こうするとスワップファイル格納用ディレクトリの中でもファイル名 - の一意性が保証される。 + り記号2個 ("//") で終わっていたら、スワップファイルの名前はフルパス + に従って付けられる。スワップファイルのファイル名をフルパス形式で表 + し、ディレクトリの区切り文字 (Win32ではドライブレターのコロンを含む) + をパーセント記号 '%' で置き換えたものが使われる。こうするとスワップ + ファイル格納用ディレクトリの中でもファイル名の一意性が保証される。 Win32では、"\\" で終わることも可能である。ただし、区切り文字のコンマ の前では "\\" でなく "//" と書かなければならない。"\\" と書くと、コ ンマがファイル名の一部と解釈されてしまうためである。したがって、'\\' @@ -2766,10 +2776,11 @@ Note 1番目の形式では、行全体がオプション指定に使われる ルを2重に編集しようとすると警告が出る。Unixでディレクトリ "/tmp" を使 うのはお勧めできない。システムがクラッシュすると、スワップファイルも失 われてしまう。ディレクトリ "/var/tmp" の中はリブート時にも大抵クリアさ - れないので、ディレクトリ "/tmp" よりもよい選択である。しかしその中には - 多くのファイルが入っているかもしれないので、ユーザーのスワップファイル - は他のファイルに紛れて分からなくなるかもしれない。ユーザーのホームディ - レクトリ内のディレクトリ "tmp" が最初に試されるのはそのためだ。 + れないので、ディレクトリ "/tmp" よりもよい選択である。しかしコンピュー + タの他の人からファイルを見ることができてしまうかもしれない上に、その中 + には多くのファイルが入っているかもしれないので、ユーザーのスワップファ + イルは他のファイルに紛れて分からなくなるかもしれない。ユーザーのホーム + ディレクトリ内のディレクトリ "tmp" が最初に試されるのはそのためだ。 リストにディレクトリを追加するときにはコマンド |:set+=|、リストからディ レクトリを除くときにはコマンド |:set-=| を使うのがよい。こうすると将来 のバージョンで異なった既定値が使われるようになったときに、問題が起きる @@ -4169,7 +4180,7 @@ Note 1番目の形式では、行全体がオプション指定に使われる グローバル このオプションはインプットメソッド (IM) をオン/オフにするのに呼ばれる 関数を指定する。 - GUI では使われない。 + MS-Windows GUI 版では使われない。 モードラインから設定した場合、式は |sandbox| で評価される。 |sandbox-option| を参照。 @@ -4283,7 +4294,7 @@ Note 1番目の形式では、行全体がオプション指定に使われる グローバル このオプションはインプットメソッド (IM) の状態を得るのに呼ばれる関数を 指定する。IMEがオンのとき、関数は正の数を返さなければならない。 - GUI では使われない。 + MS-Windows GUI 版では使われない。 例: > function ImStatusFunc() @@ -4588,7 +4599,7 @@ Note 1番目の形式では、行全体がオプション指定に使われる 'compatible' がオフになるとVimの既定値に設定されるので注意。 *'isprint'* *'isp'* -'isprint' 'isp' 文字列 (Win32とMacintoshでの既定値: +'isprint' 'isp' 文字列 (Win32とmacOSでの既定値: "@,~-255"; それ以外では: "@,161-255") グローバル このオプションで指定された文字は、画面に直接表示される。またパターン @@ -4960,18 +4971,8 @@ Note 1番目の形式では、行全体がオプション指定に使われる *'macatsui'* *'nomacatsui'* 'macatsui' 切替 (既定ではオン) グローバル - {Mac GUI 版でのみ利用可能} - これは描画が正しく行われないときのための回避策である。マルチバイト機能 - 付きでコンパイルされ、このオプションがオンになっているとATSUI テキスト - 描画が使われる。オフのときは ATSUI テキスト描画は使われない。描画に問 - 題が出るならこのオプションをオフにすること。将来のバージョンではこの問 - 題は解決し、このオプションは非推奨になるかもしれない。そのため、このオ - プションをオフにするには次のような方法を使うこと: > - if exists('&macatsui') - set nomacatsui - endif -< 描画の問題があるかをチェックするもう1つのオプションは、'termencoding' - である。 + {サポートしない} + Mac OS X GUI のコードが削除されたため、すでにサポートされなくなった。 *'magic'* *'nomagic'* 'magic' 切替 (既定ではオン) @@ -5932,8 +5933,8 @@ Note 1番目の形式では、行全体がオプション指定に使われる このオプションはクイックフィックスもしくはロケーションリストで表示する テキストを取得するのに利用される関数を指定する。クイックフィックスもし くはロケーションリストでの情報を各表示項目に付随する情報をカスタマイズ - して表示するときに利用できる。 - 関数の書き方と例については |quickfix-window-function| を参照。 + して表示するときに利用できる。関数の書き方と例については + |quickfix-window-function| を参照。この値は関数名かラムダにできる。 このオプションはセキュリティの理由により |modeline| や |sandbox| から は設定できない。 @@ -6242,7 +6243,7 @@ Note 1番目の形式では、行全体がオプション指定に使われる $VIMRUNTIME, $VIM/vimfiles/after, $HOME/vimfiles/after" - Macintosh: "$VIM:vimfiles, + macOS: "$VIM:vimfiles, $VIMRUNTIME, $VIM:vimfiles:after" Haiku: "$BE_USER_SETTINGS/vim, @@ -6754,7 +6755,7 @@ Note 1番目の形式では、行全体がオプション指定に使われる フラグ 効果 ~ f "(file 3 of 5)" の代わりに "(3 of 5)" を表示。 i "[最終行が不完全]" の代わりに "[noeol]" を表示。 - l "999 行, 888 文字" の代わりに "999L, 888C" を表示。 + l "999 行, 888 バイト" の代わりに "999L, 888B" を表示。 m "[変更あり]" の代わりに "[+]" を表示。 n "[新ファイル]" の代わりに "[新]" を表示。 r "[読込専用]" の代わりに "[読専]" を表示。 @@ -7728,7 +7729,6 @@ Note 1番目の形式では、行全体がオプション指定に使われる Amigaでは: "amiga" Haikuでは: "xterm" Macでは: "mac-ansi" - MiNTでは: "vt52" Unixでは: "ansi" VMSでは: "ansi" Win32では: "win32") @@ -7755,14 +7755,12 @@ Note 1番目の形式では、行全体がオプション指定に使われる 詳細は |arabic.txt| を参照のこと。 *'termencoding'* *'tenc'* -'termencoding' 'tenc' 文字列 (既定では ""; GTK+ GUI では "utf-8"; - Macintosh GUI では "macroman") +'termencoding' 'tenc' 文字列 (既定では ""; GTK+ GUI では "utf-8") グローバル ターミナルで使われるエンコーディング名。このオプションは、どの文字エン コーディングをキーボードが生成し、どの文字エンコーディングをディスプレ イが理解できるかを指定する。GUI版ではキーボードにのみ適用される (ディ - スプレイにはオプション 'encoding' が使われる)。Macで 'macatsui' がオフ - になっているときは例外で、'termencoding' は "macroman" になる。 + スプレイにはオプション 'encoding' が使われる)。 *E617* *E950* Note: これはGTK+ GUIには適用されない。GUIの初期化に成功した後で強制的 に 'termencoding' が "utf-8" に設定される。 @@ -7828,8 +7826,8 @@ Note 1番目の形式では、行全体がオプション指定に使われる *'termwinsize'* *'tws'* 'termwinsize' 'tws' 文字列 (既定では "") ウィンドウについてローカル - |terminal| ウィンドウのサイズ。書式: {rows}x{columns} もしくは - {rows}*{columns} + |terminal| ウィンドウが開かれるときに利用するサイズ。書式: + {rows}x{columns} もしくは {rows}*{columns} - 空の場合、ターミナルはウィンドウからサイズを取得する。 - "x" で設定されている場合 (例えば "24x80")、ターミナルのサイズはウィ ンドウサイズに調節されない。ウィンドウがそれより小さい場合、左上の部 @@ -7840,6 +7838,8 @@ Note 1番目の形式では、行全体がオプション指定に使われる - 行がゼロなら、ウィンドウの高さを使う。 - 列がゼロなら、ウィンドウの幅を使う。 - "0x0" もしくは "0*0" の場合、空の場合と同じになる。 + - |term_start()| 内のオプション "term_rows" と "term_cols" によって無 + 視される。 例: "30x0" は 30 行と、現在のウィンドウの幅を使用する。 @@ -8406,7 +8406,7 @@ Note 1番目の形式では、行全体がオプション指定に使われる *'viewdir'* *'vdir'* 'viewdir' 'vdir' 文字列 (AmigaとWin32での既定値: "$VIM/vimfiles/view", Unixでの既定値: "~/.vim/view", - Macintoshでの既定値: "$VIM:vimfiles:view" + macOSでの既定値: "$VIM:vimfiles:view" VMSでの既定値: "sys$login:vimfiles/view") グローバル {|+mksession| 機能付きでコンパイルされたときのみ有効} @@ -8910,9 +8910,9 @@ Note 1番目の形式では、行全体がオプション指定に使われる {Vim が MS-Windows 上で |terminal| 機能付きでコンパイ ルされたときのみ有効} |:terminal| コマンドで使われる winpty 共有ライブラリの名前を指定する。 - デフォルトは 32-bit 用もしくは 64-bit 用向けにビルドされているかどうか - に依存する。もしも見つからなければ、"winpty.dll" にフォールバックしよ - うとする。 + デフォルトは Vim が 32-bit 用もしくは 64-bit 用向けにビルドされている + かどうかに依存する。もしも見つからなければ、"winpty.dll" にフォールバッ + クしようとする。 環境変数は |:set_env| で展開される。 このオプションはセキュリティ上の理由により、モードライン |modeline| や サンドボックス |sandbox| から設定することはできない。 diff --git a/doc/syntax.jax b/doc/syntax.jax index 39777445b..dc8e67dcc 100644 --- a/doc/syntax.jax +++ b/doc/syntax.jax @@ -1,4 +1,4 @@ -*syntax.txt* For Vim バージョン 8.2. Last change: 2020 Jun 01 +*syntax.txt* For Vim バージョン 8.2. Last change: 2020 Aug 15 VIMリファレンスマニュアル by Bram Moolenaar @@ -1282,7 +1282,7 @@ g:doxygen_enhanced_color g:doxygen_enhanced_colour 0 Doxygen コメントに対して標準でないハイ ライトを行う。 -doxygen_my_rendering 0 HTML の太字、斜体、html_my_rendering +doxygen_my_rendering 0 HTML の太字、斜体、html_my_rendering に対する下線の描画を無効にする。 doxygen_javadoc_autobrief 1 0にすると JavaDoc の autobrief に対す @@ -1378,7 +1378,7 @@ Euphoria バージョン 3.1.1 (http://www.rapideuphoria.com/) は DOS プラッ (http://www.openeuphoria.org/) はそれをサポートしていない。 以下の拡張子のファイルは自動的に Euphoria ファイルタイプとして認識される: - + *.e, *.eu, *.ew, *.ex, *.exu, *.exw *.E, *.EU, *.EW, *.EX, *.EXU, *.EXW @@ -1739,7 +1739,7 @@ Basicだけであり、他のスクリプト言語はまだ加えられていな htmlプロセッサー言語は複数ある。html.vimはインクルードしやすいように簡素に書か れている。html.vimをインクルードするには以下の2行をその言語用の構文ファイルに -書き足すこと(この例はasp.vimからとった): +書き足すこと(この例はasp.vimからとった): > runtime! syntax/html.vim syn cluster htmlPreproc add=asp @@ -3661,7 +3661,7 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword* 例 (文字定数にマッチする): > :syntax match Character /'.'/hs=s+1,he=e-1 -< +< リージョンの定義 *:syn-region* *:syn-start* *:syn-skip* *:syn-end* *E398* *E399* @@ -3671,11 +3671,11 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword* [keepend] [extend] [excludenl] - start={start_pattern} .. - [skip={skip_pattern}] - end={end_pattern} .. + start={start-pattern} .. + [skip={skip-pattern}] + end={end-pattern} .. [{options}] - + リージョンを定義する。複数行にわたってもよい。 {group-name} "Comment" のような構文グループ名。 @@ -3695,11 +3695,11 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword* る。終了パターンに対してのみ使い道がある。適用 するパターンの前に置かねばならない。 |:syn-excludenl| - start={start_pattern} リージョンの開始を定義する検索パターン。後述の + start={start-pattern} リージョンの開始を定義する検索パターン。後述の |:syn-pattern|を参照。 - skip={skip_pattern} その中ではリージョンの終了を探さないテキストを + skip={skip-pattern} その中ではリージョンの終了を探さないテキストを 定義する検索パターン。|:syn-pattern|を参照。 - end={end_pattern} リージョンの終了を定義する検索パターン。 + end={end-pattern} リージョンの終了を定義する検索パターン。 後述の|:syn-pattern|を参照。 例: > @@ -4018,7 +4018,7 @@ contains=CONTAINED contains=CONTAINED,{group-name},.. "CONTAINED" と同様だが、{group-name}に列挙したグループは除かれ る。 - + "contains" リスト内の{group-name}はパターンであってもよい。そのパターンにマッ チするグループ名全てが含まれる("ALLBUT" が使われたときはそれが除かれる)。パター @@ -4189,7 +4189,7 @@ region item end - yes - yes - yes yes 複数のオフセットの間に ',' を入れて連結することができる。例: > :syn match String /"[^"]*"/hs=s+1,he=e-1 -< +< some "string" text ^^^^^^ ここがハイライトされる @@ -4411,7 +4411,7 @@ skipパターンも "\n" を含んでよい。ただし次の行の最初の文 る行数が最大N行になる。これは遅いマシンを使っていて、シンクロナイズする行数が 少ないとわかっているときに便利である。例: > :syntax sync maxlines=500 ccomment -< +< *:syn-sync-linebreaks* 複数行にマッチする正規表現を使っているとき、ある行に変更を施すと、前の行でマッ チしていた正規表現がマッチしなくなってしまうことがある。この場合、変更を施した @@ -4515,7 +4515,7 @@ Note: "*/" を含む文字列で行をまたぐものがあると、Cコメン *syn-sync-grouphere* *E393* *E394* :syntax sync match {sync-group-name} grouphere {group-name} "pattern" .. - + シンクロナイズ用に使うマッチを定義する。{group-name}はマッチのすぐ後に 続く構文グループの名前である。ハイライトのためのテキストのパースはマッ チの直後から始まる。この{group-name}がついたリージョンが存在しなければ @@ -4556,7 +4556,7 @@ Note: "*/" を含む文字列で行をまたぐものがあると、Cコメン :syntax sync clear あるシンクロナイズパターンをクリアするには: > - :syntax sync clear {sync-group-name} .. + :syntax sync clear {sync-group-name} .. ============================================================================== 12. 構文アイテムのリストを表示する *:syntax* *:sy* *:syn* *:syn-list* @@ -4771,7 +4771,7 @@ ctermul={color-nr} *highlight-ctermul* こでハイライトの設定に可搬性を持たせるため、X11の色設定が使われている (複雑であるが)。以下の色名を、色番号の代わりに使うことができる: - *cterm-colors* + *cterm-colors* NR-16 NR-8 COLOR NAME ~ 0 0 Black 1 4 DarkBlue @@ -4880,7 +4880,7 @@ guisp={color-name} *highlight-guisp* くる。このためシングルクォートを名前に含めることはできない。 例: > :hi comment guifg='salmon pink' -< +< *gui-colors* 推奨されている色名 (これらはほとんどのシステムで利用可能である) Red LightRed DarkRed @@ -5062,7 +5062,7 @@ Scrollbar メインウィンドウのスクロールバーの文字と背景。 *hl-Tooltip* Tooltip ツールチップのフォント、文字、背景。 使用可能なhighlightの引数: font, guibg, guifg. - + NOTE: MotifとAthenaでは 'guifontset' が空かどうかにかかわらず、 常に引数fontで実際のフォントセットを指定する。そしてそれが現在 の|:language|に結び付けられる。 diff --git a/doc/testing.jax b/doc/testing.jax index a744689d8..bbf6c5621 100644 --- a/doc/testing.jax +++ b/doc/testing.jax @@ -1,4 +1,4 @@ -*testing.txt* For Vim バージョン 8.2. Last change: 2020 Jul 10 +*testing.txt* For Vim バージョン 8.2. Last change: 2020 Sep 06 VIMリファレンスマニュアル by Bram Moolenaar @@ -20,18 +20,17 @@ VimおよびVim scriptのテスト *testing-support* Vimはビルド後にテストできる。通常は "make test" を使用する。テストはディレクト リ "src/testdir" にある。 -時間の経過とともに追加されたテストには、いくつかのタイプがある: - test33.in 最も古い、これらのいずれも追加しないこと - test_something.in 旧形式のテスト +時間の経過とともに追加されたテストには、2つのタイプがある: + test20.in 最も古い、tiny と small ビルド用のみ test_something.vim 新形式のテスト *new-style-testing* -新形式のテストとして新しいテストを追加する必要がある。これらは -|assert_equal()| などの関数を使用して、テストコマンドと期待される結果を1か所に -保持する。 +新しいテストは新形式のテストとして追加する必要がある。このテストスクリプトは +test_.vim という命名になる ( はテストする対象の機能に置き換 +える)。これらは、テストコマンドと期待される結果を1か所に保持するために、 +|assert_equal()| などの関数を使用する。 *old-style-testing* -場合によっては、旧型式のテストを使用する必要がある。例えば、|+eval| 機能なしで -Vimをテストするとき。 +|+eval| 機能なしでVimをテストするときのみこのテストを使う。 詳細は src/testdir/README.txt ファイルを確認のこと。 @@ -289,8 +288,9 @@ assert_exception({error} [, {msg}]) *assert_exception()* catch call assert_exception('E492:') endtry - -assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()* +< + *assert_fails()* +assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]]) {cmd}を実行しエラーを生成しなかった場合か、エラーメッセージの 中に{error}が見つからない場合、|v:errors| にエラーメッセージを 追加する。|assert-return| も参照。 @@ -310,6 +310,16 @@ assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()* 列を使用する: > assert_fails('cmd', ['', 'E987:']) < + もし {msg} が空の場合は利用されない。引数 {lnum} を渡す時にデ + フォルトメッセージを取得するにはこれを使うこと。 + + {lnum} が非負数で設定され、引数 {error} が設定されてマッチした + 時、エラーが報告されるときの行番号と比較される。行番号は関数内 + かスクリプト内での行番号になる。 + + {context} が存在すると、 パターンとして使われ {lnum} が位置する + コンテキスト (スクリプト名か関数名) に対してマッチする。 + Note: ビープ音の発生はエラーとは見なされず、いくつかのコマンド は失敗時にビープ音を鳴らすだけである。これらについては |assert_beeps()| を使用すること。 @@ -317,7 +327,7 @@ assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()* |method| としても使用できる: > GetCmd()->assert_fails('E99:') -assert_false({actual} [, {msg}]) *assert_false()* +assert_false({actual} [, {msg}]) *assert_false()* |assert_equal()|と同様に、{actual}がfalseでない場合、|v:errors| にエラーメッセージを追加する。 |assert-return| も参照。 diff --git a/en/cmdline.txt b/en/cmdline.txt index ecaa73e89..91aab3b26 100644 --- a/en/cmdline.txt +++ b/en/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 8.2. Last change: 2020 Apr 23 +*cmdline.txt* For Vim version 8.2. Last change: 2020 Aug 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -876,7 +876,7 @@ Also see |`=|. *:* ** *:* ** *:* ** *:* ** *:* ** *:* ** - *:* ** + *:* ** *:* ** *:* ** *:* ** *:* ** *E499* *E500* Note: these are typed literally, they are not special keys! @@ -903,12 +903,16 @@ Note: these are typed literally, they are not special keys! events). When executing a ":source" command, is replaced with the file name of the sourced file. *E498* - When executing a function, is replaced with: - "function {function-name}[{lnum}]" - function call nesting is indicated like this: - "function {function-name1}[{lnum}]..{function-name2}[{lnum}]" + When executing a function, is replaced with the call stack, + as with (this is for backwards compatibility, using + is preferred). Note that filename-modifiers are useless when is - used inside a function. + not used inside a script. + is replaced with the call stack, using + "function {function-name}[{lnum}]" for a function line + and "script {file-name}[{lnum}]" for a script line, and + ".." in between items. E.g.: + "function {function-name1}[{lnum}]..{function-name2}[{lnum}]" When executing a ":source" command, is replaced with the line number. *E842* When executing a function it's the line number relative to @@ -1126,7 +1130,8 @@ CTRL-C Continue in Command-line mode. The command-line under the in Normal mode. There is no redraw, thus the window will remain visible. :quit Discard the command line and go back to Normal mode. - ":close", ":exit", ":xit" and CTRL-\ CTRL-N also work. + ":close", CTRL-W c, ":exit", ":xit" and CTRL-\ CTRL-N also + work. :qall Quit Vim, unless there are changes in some buffer. :qall! Quit Vim, discarding changes to any buffer. diff --git a/en/helphelp.txt b/en/helphelp.txt index 7771a505b..8dcaa1f50 100644 --- a/en/helphelp.txt +++ b/en/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 8.2. Last change: 2020 Mar 01 +*helphelp.txt* For Vim version 8.2. Last change: 2020 Jul 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -369,14 +369,16 @@ highlighting. So do these: You can find the details in $VIMRUNTIME/syntax/help.vim *inclusion* -Some people make a big deal about using "his" when referring to the user, -thinking it means we assume the user is male. That is of course not the case, -it's just a habit of writing help text, which quite often is many years old. -Also, a lot of the text is written by contributors for who English is not -their first language. We do not make any assumptions about the gender of the -user, no matter how the text is phrased. And we do not want to waste time on -this discussion. The goal is that the reader understands how Vim works, the -exact wording is secondary. +Vim is for everybody, no matter race, gender or anything. Some people make a +big deal about using "he" or "his" when referring to the user, thinking it +means we assume the user is male. That is not the case, it's just a habit of +writing help text, which quite often is many years old. Also, a lot of the +text is written by contributors for whom English is not their first language. +We do not make any assumptions about the gender of the user, no matter how the +text is phrased. Some people have suggested using "they", but that is not +regular English. We do not want to spend much time on this discussion. The +goal is that the reader understands how Vim works, the exact wording is +secondary. vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/en/index.txt b/en/index.txt index 0d47cc293..ed6916f62 100644 --- a/en/index.txt +++ b/en/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 8.2. Last change: 2020 May 26 +*index.txt* For Vim version 8.2. Last change: 2020 May 31 VIM REFERENCE MANUAL by Bram Moolenaar @@ -85,7 +85,7 @@ tag char action in Insert mode ~ |i_CTRL-R_CTRL-P| CTRL-R CTRL-P {register} insert the contents of a register literally and fix indent. - CTRL-S (used for terminal control flow) + CTRL-S not used or used for terminal control flow |i_CTRL-T| CTRL-T insert one shiftwidth of indent in current line |i_CTRL-U| CTRL-U delete all entered characters in the current @@ -220,9 +220,9 @@ tag char note action in Normal mode ~ |CTRL-N| CTRL-N 1 same as "j" |CTRL-O| CTRL-O 1 go to N older entry in jump list |CTRL-P| CTRL-P 1 same as "k" - CTRL-Q (used for terminal control flow) + CTRL-Q not used, or used for terminal control flow |CTRL-R| CTRL-R 2 redo changes which were undone with 'u' - CTRL-S (used for terminal control flow) + CTRL-S not used, or used for terminal control flow |CTRL-T| CTRL-T jump to N older Tag in tag list |CTRL-U| CTRL-U scroll N lines Upwards (default: half a screen) @@ -440,6 +440,7 @@ tag char note action in Normal mode ~ || ":ta" to the keyword at the mouse click || 1 same as "w" || same as "CTRL-T" +|| same as "g" || ["x] 2 same as "x" |N| {count} remove the last digit from {count} || 1 same as "j" @@ -587,6 +588,8 @@ tag command action in Normal mode ~ following the file name. |CTRL-W_gt| CTRL-W g t same as `gt`: go to next tab page |CTRL-W_gT| CTRL-W g T same as `gT`: go to previous tab page +|CTRL-W_g| CTRL-W g same as |g|: go to last accessed tab + page. |CTRL-W_h| CTRL-W h go to Nth left window (stop at first window) |CTRL-W_i| CTRL-W i split window and jump to declaration of identifier under the cursor @@ -805,6 +808,7 @@ tag char note action in Normal mode ~ |g| g same as g same as |g| g same as +|g| g go to the last accessed tab page. |g| g 1 same as "gk" ============================================================================== @@ -828,7 +832,7 @@ tag char note action in Normal mode ~ |zD| zD delete folds recursively |zE| zE eliminate all folds |zF| zF create a fold for N lines -|zG| zG temporarily mark word as good spelled word +|zG| zG temporarily mark word as correctly spelled |zH| zH when 'wrap' off scroll half a screenwidth to the right |zL| zL when 'wrap' off scroll half a screenwidth @@ -837,7 +841,7 @@ tag char note action in Normal mode ~ |zN| zN set 'foldenable' |zO| zO open folds recursively |zR| zR set 'foldlevel' to the deepest fold -|zW| zW temporarily mark word as bad spelled word +|zW| zW temporarily mark word as incorrectly spelled |zX| zX re-apply 'foldlevel' |z^| z^ cursor on line N (default line above window), otherwise like "z-" @@ -849,7 +853,7 @@ tag char note action in Normal mode ~ position the cursor at the end (right side) of the screen |zf| zf{motion} create a fold for Nmove text -|zg| zg permanently mark word as good spelled word +|zg| zg permanently mark word as correctly spelled |zh| zh when 'wrap' off scroll screen N characters to the right |zi| zi toggle 'foldenable' @@ -870,7 +874,7 @@ tag char note action in Normal mode ~ |zuW| zuW undo |zW| |zuG| zuG undo |zG| |zv| zv open enough folds to view the cursor line -|zw| zw permanently mark word as bad spelled word +|zw| zw permanently mark word as incorrectly spelled |zx| zx re-apply 'foldlevel' and do "zv" |zz| zz redraw, cursor line at center of window |z| z same as "zh" @@ -1056,7 +1060,7 @@ tag command action in Command-line editing mode ~ |c_CTRL-R_CTRL-O| CTRL-R CTRL-O {regname} insert the contents of a register or object under the cursor literally - CTRL-S (used for terminal control flow) + CTRL-S not used, or used for terminal control flow |c_CTRL-T| CTRL-T previous match when 'incsearch' is active |c_CTRL-U| CTRL-U remove all characters |c_CTRL-V| CTRL-V insert next non-digit literally, insert three diff --git a/en/map.txt b/en/map.txt index c142f231b..8900026a1 100644 --- a/en/map.txt +++ b/en/map.txt @@ -1,4 +1,4 @@ -*map.txt* For Vim version 8.2. Last change: 2020 Apr 23 +*map.txt* For Vim version 8.2. Last change: 2020 Sep 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -191,6 +191,12 @@ whether to use the "," mapping or the longer one. To avoid this add the argument. Then the mapping will be used when it matches, Vim does not wait for more characters to be typed. However, if the characters were already typed they are used. +Note that this works when the mapping fully matches and is found +before any partial matches. This works when: +- There is only one matching buffer-local mapping, since these are always + found before global mappings. +- There is another buffer-local mapping that partly matches, but it is + defined earlier (last defined mapping is found first). *:map-* *:map-silent* To define a mapping which will not be echoed on the command line, add @@ -283,15 +289,8 @@ Here is an example that inserts a list number that increases: > CTRL-L inserts the next number, CTRL-R resets the count. CTRL-R returns an empty string, so that nothing is inserted. -Note that there are some tricks to make special keys work and escape CSI bytes -in the text. The |:map| command also does this, thus you must avoid that it -is done twice. This does not work: > - :imap "" -Because the . This does work: > - :imap "\u611B" -Using 0x80 as a single byte before other text does not work, it will be seen -as a special key. +Note that using 0x80 as a single byte before other text does not work, it will +be seen as a special key. 1.3 MAPPING AND MODES *:map-modes* @@ -595,7 +594,7 @@ construct can be used: character 27 character 127 character 114 ('r') shifted ('R') -This is useful to specify a (multi-byte) character in a 'keymap' file. +This is useful to specify a (multibyte) character in a 'keymap' file. Upper and lowercase differences are ignored. *map-comments* @@ -843,11 +842,10 @@ When modifyOtherKeys is enabled you can map and : > imap {{{ Without modifyOtherKeys and are indistinguishable from Esc. -A known side effect effect is that in Insert mode the raw escape sequence is -inserted after the CTRL-V key. This can be used to check whether -modifyOtherKeys is enabled: In Insert mode type CTRL-SHIFT-V CTRL-V, if you -get one byte then modifyOtherKeys is off, if you get <1b>27;5;118~ then it is -on. +A known side effect is that in Insert mode the raw escape sequence is inserted +after the CTRL-V key. This can be used to check whether modifyOtherKeys is +enabled: In Insert mode type CTRL-SHIFT-V CTRL-V, if you get one byte then +modifyOtherKeys is off, if you get <1b>27;5;118~ then it is on. When the 'esckeys' option is off, then modifyOtherKeys will be disabled in Insert mode to avoid every key with a modifier causing Insert mode to end. @@ -876,35 +874,47 @@ g@{motion} Call the function set by the 'operatorfunc' option. Here is an example that counts the number of spaces with : > - nmap :set opfunc=CountSpacesg@ - vmap :call CountSpaces(visualmode(), 1) + nnoremap CountSpaces() + xnoremap CountSpaces() + " doubling works on a line + nnoremap CountSpaces() .. '_' - function! CountSpaces(type, ...) - let sel_save = &selection - let &selection = "inclusive" - let reg_save = @@ - - if a:0 " Invoked from Visual mode, use gv command. - silent exe "normal! gvy" - elseif a:type == 'line' - silent exe "normal! '[V']y" - else - silent exe "normal! `[v`]y" - endif - - echomsg strlen(substitute(@@, '[^ ]', '', 'g')) + function CountSpaces(type = '') abort + if a:type == '' + set opfunc=CountSpaces + return 'g@' + endif - let &selection = sel_save - let @@ = reg_save + let sel_save = &selection + let reg_save = getreginfo('"') + let cb_save = &clipboard + let visual_marks_save = [getpos("'<"), getpos("'>")] + + try + set clipboard= selection=inclusive + let commands = #{line: "'[V']y", char: "`[v`]y", block: "`[\`]y"} + silent exe 'noautocmd keepjumps normal! ' .. get(commands, a:type, '') + echom getreg('"')->count(' ') + finally + call setreg('"', reg_save) + call setpos("'<", visual_marks_save[0]) + call setpos("'>", visual_marks_save[1]) + let &clipboard = cb_save + let &selection = sel_save + endtry endfunction +An mapping is used to be able to fetch any prefixed count and register. +This also avoids using a command line, which would trigger CmdlineEnter and +CmdlineLeave autocommands. + Note that the 'selection' option is temporarily set to "inclusive" to be able to yank exactly the right text by using Visual mode from the '[ to the '] mark. -Also note that there is a separate mapping for Visual mode. It removes the -"'<,'>" range that ":" inserts in Visual mode and invokes the function with -visualmode() and an extra argument. +Also note that the 'clipboard' option is temporarily emptied to avoid +clobbering the `"*` or `"+` registers, if its value contains the item `unnamed` +or `unnamedplus`. ============================================================================== 2. Abbreviations *abbreviations* *Abbreviations* @@ -1168,6 +1178,10 @@ When executing an autocommand or a user command, it will run in the context of the script it was defined in. This makes it possible that the command calls a local function or uses a local mapping. +In case the value is used in a context where cannot be correctly +expanded, use the expand() function: > + let &includexpr = expand('') .. 'My_includeexpr()' + Otherwise, using "" outside of a script context is an error. If you need to get the script number to use in a complicated script, you can diff --git a/en/mbyte.txt b/en/mbyte.txt index 6a973fdc0..bbfd5d38c 100644 --- a/en/mbyte.txt +++ b/en/mbyte.txt @@ -128,7 +128,7 @@ There are several ways to enter multi-byte characters: - For MS-Windows IME can be used. See |IME|. - For all systems keymaps can be used. See |mbyte-keymap|. -The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose +The options 'iminsert', 'imsearch' and 'imcmdline' can be used to choose the different input methods or disable them temporarily. ============================================================================== @@ -141,8 +141,8 @@ in, or just use a certain locale inside Vim. WHAT IS A LOCALE? *locale* -There are many of languages in the world. And there are different cultures -and environments at least as much as the number of languages. A linguistic +There are many languages in the world. And there are different cultures and +environments at least as many as the number of languages. A linguistic environment corresponding to an area is called "locale". This includes information about the used language, the charset, collating order for sorting, date format, currency format and so on. For Vim only the language and charset @@ -889,7 +889,7 @@ input_server_name is your |IM-server| name (check your |IM-server| your_input_style is one of |OverTheSpot|, |OffTheSpot|, |Root|. See also |xim-input-style|. -*international may not necessary if you use X11R6. +*international may not be necessary if you use X11R6. *.inputMethod and *.preeditType are optional if you use X11R6. For example, when you are using kinput2 as |IM-server|, > @@ -952,7 +952,7 @@ automatically. This works on not only insert-normal mode, but also search-command input and replace mode. -The options 'iminsert', 'imsearch' and 'imcmdline' can be used to chose +The options 'iminsert', 'imsearch' and 'imcmdline' can be used to choose the different input methods or disable them temporarily. WHAT IS IME diff --git a/en/mlang.txt b/en/mlang.txt index 629907c16..a79250ad3 100644 --- a/en/mlang.txt +++ b/en/mlang.txt @@ -1,4 +1,4 @@ -*mlang.txt* For Vim version 8.2. Last change: 2019 May 05 +*mlang.txt* For Vim version 8.2. Last change: 2020 Aug 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -7,7 +7,7 @@ Multi-language features *multilang* *multi-lang* This is about using messages and menus in various languages. For editing -multi-byte text see |multibyte|. +multibyte text see |multibyte|. The basics are explained in the user manual: |usr_45.txt|. @@ -37,6 +37,7 @@ use of "-" and "_". :lan[guage] mes[sages] :lan[guage] cty[pe] :lan[guage] tim[e] +:lan[guage] col[late] Print the current language (aka locale). With the "messages" argument the language used for messages is printed. Technical: LC_MESSAGES. @@ -44,15 +45,19 @@ use of "-" and "_". character encoding is printed. Technical: LC_CTYPE. With the "time" argument the language used for strftime() is printed. Technical: LC_TIME. + With the "collate" argument the language used for + collation order is printed. Technical: LC_COLLATE. Without argument all parts of the locale are printed (this is system dependent). The current language can also be obtained with the - |v:lang|, |v:ctype| and |v:lc_time| variables. + |v:lang|, |v:ctype|, |v:collate| and |v:lc_time| + variables. :lan[guage] {name} :lan[guage] mes[sages] {name} :lan[guage] cty[pe] {name} :lan[guage] tim[e] {name} +:lan[guage] col[late] {name} Set the current language (aka locale) to {name}. The locale {name} must be a valid locale on your system. Some systems accept aliases like "en" or @@ -72,7 +77,10 @@ use of "-" and "_". With the "time" argument the language used for time and date messages is set. This affects strftime(). This sets $LC_TIME. - Without an argument both are set, and additionally + With the "collate" argument the language used for the + collation order is set. This affects sorting of + characters. This sets $LC_COLLATE. + Without an argument all are set, and additionally $LANG is set. When compiled with the |+float| feature the LC_NUMERIC value will always be set to "C", so that floating diff --git a/en/options.txt b/en/options.txt index 4e78a2fa6..85a0296e0 100644 --- a/en/options.txt +++ b/en/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 8.2. Last change: 2020 Jun 10 +*options.txt* For Vim version 8.2. Last change: 2020 Sep 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -703,6 +703,9 @@ A jump table for the options with a short description can be found at |Q_op|. The value "double" cannot be used if 'listchars' or 'fillchars' contains a character that would be double width. + The values are overruled for characters specified with + |setcellwidths()|. + There are a number of CJK fonts for which the width of glyphs for those characters are solely based on how many octets they take in legacy/traditional CJK encodings. In those encodings, Euro, @@ -727,8 +730,8 @@ A jump table for the options with a short description can be found at |Q_op|. 'antialias' 'anti' boolean (default: off) global {only available when compiled with GUI enabled - on Mac OS X} - This option only has an effect in the GUI version of Vim on Mac OS X + on macOS} + This option only has an effect in the GUI version of Vim on macOS v10.2 or later. When on, Vim will use smooth ("antialiased") fonts, which can be easier to read at certain sizes on certain displays. Setting this option can sometimes cause problems if 'guifont' is set @@ -1951,9 +1954,11 @@ A jump table for the options with a short description can be found at |Q_op|. {not available when compiled without the |+textprop| or |+quickfix| feature} When 'completeopt' contains "popup" then this option is used for the - properties of the info popup when it is created. You can also use - |popup_findinfo()| and then set properties for an existing info popup - with |popup_setoptions()|. See |complete-popup|. + properties of the info popup when it is created. If an info popup + window already exists it is closed, so that the option value is + applied when it is created again. + You can also use |popup_findinfo()| and then set properties for an + existing info popup with |popup_setoptions()|. See |complete-popup|. *'concealcursor'* *'cocu'* @@ -2713,6 +2718,11 @@ A jump table for the options with a short description can be found at |Q_op|. for Unix: ".,~/tmp,/var/tmp,/tmp") global List of directory names for the swap file, separated with commas. + Recommended value: ".,~/vimswap//" - this will put the swap file next + to the edited file if possible, and in your personal swap directory + otherwise. Make sure "~/vimswap//" is only readable for you. + + Possible items: - The swap file will be created in the first directory where this is possible. - Empty means that no swap file will be used (recovery is @@ -2726,8 +2736,9 @@ A jump table for the options with a short description can be found at |Q_op|. is replaced with the path name of the edited file. - For Unix and Win32, if a directory ends in two path separators "//", the swap file name will be built from the complete path to the file - with all path separators substituted to percent '%' signs. This will - ensure file name uniqueness in the preserve directory. + with all path separators replaced by percent '%' signs (including + the colon following the drive letter on Win32). This will ensure + file name uniqueness in the preserve directory. On Win32, it is also possible to end with "\\". However, When a separating comma is following, you must use "//", since "\\" will include the comma in the file name. Therefore it is recommended to @@ -2747,9 +2758,10 @@ A jump table for the options with a short description can be found at |Q_op|. the same file twice will result in a warning. Using "/tmp" on Unix is discouraged: When the system crashes you lose the swap file. "/var/tmp" is often not cleared when rebooting, thus is a better - choice than "/tmp". But it can contain a lot of files, your swap - files get lost in the crowd. That is why a "tmp" directory in your - home directory is tried first. + choice than "/tmp". But others on the computer may be able to see the + files, and it can contain a lot of files, your swap files get lost in + the crowd. That is why a "tmp" directory in your home directory is + tried first. The use of |:set+=| and |:set-=| is preferred when adding or removing directories from the list. This avoids problems when a future version uses another default. @@ -2824,7 +2836,7 @@ A jump table for the options with a short description can be found at |Q_op|. This is specified with 'fileencoding'. The conversion is done with iconv() or as specified with 'charconvert'. - If you need to know whether 'encoding' is a multi-byte encoding, you + If you need to know whether 'encoding' is a multibyte encoding, you can use: > if has("multi_byte_encoding") < @@ -4133,7 +4145,7 @@ A jump table for the options with a short description can be found at |Q_op|. global This option specifies a function that will be called to activate or deactivate the Input Method. - It is not used in the GUI. + It is not used in the MS-Windows GUI version. The expression will be evaluated in the |sandbox| when set from a modeline, see |sandbox-option|. @@ -4242,7 +4254,7 @@ A jump table for the options with a short description can be found at |Q_op|. global This option specifies a function that is called to obtain the status of Input Method. It must return a positive number when IME is active. - It is not used in the GUI. + It is not used in the MS-Windows GUI version. Example: > function ImStatusFunc() @@ -4538,7 +4550,7 @@ A jump table for the options with a short description can be found at |Q_op|. set and to the Vim default value when 'compatible' is reset. *'isprint'* *'isp'* -'isprint' 'isp' string (default for Win32 and Macintosh: +'isprint' 'isp' string (default for Win32 and macOS: "@,~-255"; otherwise: "@,161-255") global The characters given by this option are displayed directly on the @@ -4915,18 +4927,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'macatsui'* *'nomacatsui'* 'macatsui' boolean (default on) global - {only available in Mac GUI version} - This is a workaround for when drawing doesn't work properly. When set - and compiled with multi-byte support ATSUI text drawing is used. When - not set ATSUI text drawing is not used. Switch this option off when - you experience drawing problems. In a future version the problems may - be solved and this option becomes obsolete. Therefore use this method - to unset it: > - if exists('&macatsui') - set nomacatsui - endif -< Another option to check if you have drawing problems is - 'termencoding'. + {not supported} + No longer supported, as the Mac OS X GUI code was removed. *'magic'* *'nomagic'* 'magic' boolean (default on) @@ -5911,7 +5913,8 @@ A jump table for the options with a short description can be found at |Q_op|. customize the information displayed in the quickfix or location window for each entry in the corresponding quickfix or location list. See |quickfix-window-function| for an explanation of how to write the - function and an example. + function and an example. The value can be the name of a function or a + lambda. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -6188,7 +6191,7 @@ A jump table for the options with a short description can be found at |Q_op|. screen. If the statusline is given by 'statusline' (i.e. not empty), this option takes precedence over 'ruler' and 'rulerformat' If the number of characters displayed is different from the number of - bytes in the text (e.g., for a TAB or a multi-byte character), both + bytes in the text (e.g., for a TAB or a multibyte character), both the text column (byte number) and the screen column are shown, separated with a dash. For an empty line "0-1" is shown. @@ -6231,7 +6234,7 @@ A jump table for the options with a short description can be found at |Q_op|. $VIMRUNTIME, $VIM/vimfiles/after, $HOME/vimfiles/after" - Macintosh: "$VIM:vimfiles, + macOS: "$VIM:vimfiles, $VIMRUNTIME, $VIM:vimfiles:after" Haiku: "$BE_USER_SETTINGS/vim, @@ -6561,7 +6564,7 @@ A jump table for the options with a short description can be found at |Q_op|. For the Amiga the default is ">". For MS-Windows the default is ">%s 2>&1". The output is directly saved in a file and not echoed to the screen. - For Unix the default it "| tee". The stdout of the compiler is saved + For Unix the default is "| tee". The stdout of the compiler is saved in a file and echoed to the screen. If the 'shell' option is "csh" or "tcsh" after initializations, the default becomes "|& tee". If the 'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta", @@ -6730,7 +6733,7 @@ A jump table for the options with a short description can be found at |Q_op|. flag meaning when present ~ f use "(3 of 5)" instead of "(file 3 of 5)" i use "[noeol]" instead of "[Incomplete last line]" - l use "999L, 888C" instead of "999 lines, 888 characters" + l use "999L, 888B" instead of "999 lines, 888 bytes" m use "[+]" instead of "[Modified]" n use "[New]" instead of "[New File]" r use "[RO]" instead of "[readonly]" @@ -7708,7 +7711,6 @@ A jump table for the options with a short description can be found at |Q_op|. on Amiga: "amiga" on Haiku: "xterm" on Mac: "mac-ansi" - on MiNT: "vt52" on Unix: "ansi" on VMS: "ansi" on Win 32: "win32") @@ -7736,14 +7738,12 @@ A jump table for the options with a short description can be found at |Q_op|. For further details see |arabic.txt|. *'termencoding'* *'tenc'* -'termencoding' 'tenc' string (default ""; with GTK+ GUI: "utf-8"; with - Macintosh GUI: "macroman") +'termencoding' 'tenc' string (default ""; with GTK+ GUI: "utf-8") global Encoding used for the terminal. This specifies what character encoding the keyboard produces and the display will understand. For the GUI it only applies to the keyboard ('encoding' is used for the - display). Except for the Mac when 'macatsui' is off, then - 'termencoding' should be "macroman". + display). *E617* *E950* Note: This does not apply to the GTK+ GUI. After the GUI has been successfully initialized, 'termencoding' is forcibly set to "utf-8". @@ -7808,8 +7808,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'termwinsize'* *'tws'* 'termwinsize' 'tws' string (default "") local to window - Size of the |terminal| window. Format: {rows}x{columns} or - {rows}*{columns}. + Size used when opening the |terminal| window. Format: + {rows}x{columns} or {rows}*{columns}. - When empty the terminal gets the size from the window. - When set with a "x" (e.g., "24x80") the terminal size is not adjusted to the window size. If the window is smaller only the @@ -7820,6 +7820,8 @@ A jump table for the options with a short description can be found at |Q_op|. - When rows is zero then use the height of the window. - When columns is zero then use the width of the window. - Using "0x0" or "0*0" is the same as empty. + - Can be overruled in the |term_start()| options with "term_rows" and + "term_cols". Examples: "30x0" uses 30 rows and the current window width. @@ -8366,7 +8368,7 @@ A jump table for the options with a short description can be found at |Q_op|. >= 14 Anything pending in a ":finally" clause. >= 15 Every executed Ex command from a script (truncated at 200 characters). - >= 16 Every executed Ex command + >= 16 Every executed Ex command. This option can also be set with the "-V" argument. See |-V|. This option is also set by the |:verbose| command. @@ -8389,7 +8391,7 @@ A jump table for the options with a short description can be found at |Q_op|. 'viewdir' 'vdir' string (default for Amiga and Win32: "$VIM/vimfiles/view", for Unix: "~/.vim/view", - for Macintosh: "$VIM:vimfiles:view" + for macOS: "$VIM:vimfiles:view" for VMS: "sys$login:vimfiles/view") global {not available when compiled without the |+mksession| @@ -8905,7 +8907,7 @@ A jump table for the options with a short description can be found at |Q_op|. {only available when compiled with the |terminal| feature on MS-Windows} Specifies the name of the winpty shared library, used for the - |:terminal| command. The default depends on whether was build as a + |:terminal| command. The default depends on whether Vim was built as a 32-bit or 64-bit executable. If not found, "winpty.dll" is tried as a fallback. Environment variables are expanded |:set_env|. diff --git a/en/syntax.txt b/en/syntax.txt index 8c2d35342..9c5656719 100644 --- a/en/syntax.txt +++ b/en/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 8.2. Last change: 2020 Jun 01 +*syntax.txt* For Vim version 8.2. Last change: 2020 Aug 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1403,7 +1403,7 @@ to your startup file. EUPHORIA *euphoria3.vim* *euphoria4.vim* *ft-euphoria-syntax* -Two syntax highlighting files exists for Euphoria. One for Euphoria +Two syntax highlighting files exist for Euphoria. One for Euphoria version 3.1.1, which is the default syntax highlighting file, and one for Euphoria version 4.0.5 or later. @@ -1937,7 +1937,7 @@ new highlightings for the following groups.: Debug, DebugSpecial, DebugString, DebugBoolean, DebugType which are used for the statement itself, special characters used in debug strings, strings, boolean constants and types (this, super) respectively. I -have opted to chose another background for those statements. +have opted to choose another background for those statements. Javadoc is a program that takes special comments out of Java program files and creates HTML pages. The standard configuration will highlight this HTML code @@ -3648,7 +3648,7 @@ DEFINING FOLDLEVEL *:syn-foldlevel* start: Use level of item containing start of line. minimum: Use lowest local-minimum level of items on line. - The default is 'start'. Use 'minimum' to search a line horizontally + The default is "start". Use "minimum" to search a line horizontally for the lowest level contained on the line that is followed by a higher level. This produces more natural folds when syntax items may close and open horizontally within a line. @@ -3795,9 +3795,9 @@ DEFINING REGIONS *:syn-region* *:syn-start* *:syn-skip* *:syn-end* [keepend] [extend] [excludenl] - start={start_pattern} .. - [skip={skip_pattern}] - end={end_pattern} .. + start={start-pattern} .. + [skip={skip-pattern}] + end={end-pattern} .. [{options}] This defines one region. It may span several lines. @@ -3819,12 +3819,12 @@ DEFINING REGIONS *:syn-region* *:syn-start* *:syn-skip* *:syn-end* extend a containing match or item. Only useful for end patterns. Must be given before the patterns it applies to. |:syn-excludenl| - start={start_pattern} The search pattern that defines the start of + start={start-pattern} The search pattern that defines the start of the region. See |:syn-pattern| below. - skip={skip_pattern} The search pattern that defines text inside + skip={skip-pattern} The search pattern that defines text inside the region where not to look for the end pattern. See |:syn-pattern| below. - end={end_pattern} The search pattern that defines the end of + end={end-pattern} The search pattern that defines the end of the region. See |:syn-pattern| below. Example: > @@ -4348,7 +4348,7 @@ Notes: - A negative offset for an end pattern may not always work, because the end pattern may be detected when the highlighting should already have stopped. - Before Vim 7.2 the offsets were counted in bytes instead of characters. - This didn't work well for multi-byte characters, so it was changed with the + This didn't work well for multibyte characters, so it was changed with the Vim 7.2 release. - The start of a match cannot be in a line other than where the pattern matched. This doesn't work: "a\nb"ms=e. You can make the highlighting diff --git a/en/testing.txt b/en/testing.txt index f1173a1f0..96446853c 100644 --- a/en/testing.txt +++ b/en/testing.txt @@ -1,4 +1,4 @@ -*testing.txt* For Vim version 8.2. Last change: 2020 Jul 11 +*testing.txt* For Vim version 8.2. Last change: 2020 Sep 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -20,18 +20,17 @@ and for testing plugins. Vim can be tested after building it, usually with "make test". The tests are located in the directory "src/testdir". -There are several types of tests added over time: - test33.in oldest, don't add any of these - test_something.in old style tests +There are two types of tests added over time: + test20.in oldest, only for tiny and small builds test_something.vim new style tests *new-style-testing* -New tests should be added as new style tests. These use functions such as -|assert_equal()| to keep the test commands and the expected result in one -place. +New tests should be added as new style tests. The test scripts are named +test_.vim (replace with the feature under test). These use +functions such as |assert_equal()| to keep the test commands and the expected +result in one place. *old-style-testing* -In some cases an old style test needs to be used. E.g. when testing Vim -without the |+eval| feature. +These tests are used only for testing Vim without the |+eval| feature. Find more information in the file src/testdir/README.txt. @@ -292,8 +291,9 @@ assert_exception({error} [, {msg}]) *assert_exception()* catch call assert_exception('E492:') endtry - -assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()* +< + *assert_fails()* +assert_fails({cmd} [, {error} [, {msg} [, {lnum} [, {context}]]]]) Run {cmd} and add an error message to |v:errors| if it does NOT produce an error or when {error} is not found in the error message. Also see |assert-return|. @@ -312,13 +312,25 @@ assert_fails({cmd} [, {error} [, {msg}]]) *assert_fails()* string for the first error: > assert_fails('cmd', ['', 'E987:']) < + If {msg} is empty then it is not used. Do this to get the + default message when passing the {lnum} argument. + + When {lnum} is present and not negative, and the {error} + argument is present and matches, then this is compared with + the line number at which the error was reported. That can be + the line number in a function or in a script. + + When {context} is present it is used as a pattern and matched + against the context (script name or function name) where + {lnum} is located in. + Note that beeping is not considered an error, and some failing commands only beep. Use |assert_beeps()| for those. Can also be used as a |method|: > GetCmd()->assert_fails('E99:') -assert_false({actual} [, {msg}]) *assert_false()* +assert_false({actual} [, {msg}]) *assert_false()* When {actual} is not false an error message is added to |v:errors|, like with |assert_equal()|. Also see |assert-return|.