diff --git a/doc/builtin.jax b/doc/builtin.jax index e898b501c..493dce2ce 100644 --- a/doc/builtin.jax +++ b/doc/builtin.jax @@ -1,4 +1,4 @@ -*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Aug 06 +*builtin.txt* For Vim バージョン 9.1. Last change: 2025 Aug 08 VIMリファレンスマニュアル by Bram Moolenaar @@ -1832,17 +1832,26 @@ charidx({string}, {idx} [, {countcc} [, {utf16}]]) 戻り値の型: |Number| -chdir({dir}) *chdir()* +chdir({dir} [, {scope}]) *chdir()* + 現在の作業ディレクトリを {dir} に変更する。変更するスコープは + 以下のように決定される: + {scope} が指定されていない場合、現在の作業ディレクトリは現在の + ディレクトリのスコープに変更される: + - ウィンドウローカルディレクトリ (|:lcd|) が設定されている + 場合、そのスコープの現在の作業ディレクトリを変更する。 + - タブページローカルディレクトリ (|:tcd|) が設定されている + 場合、そのスコープの現在のディレクトリを変更する。 + - それ以外の場合は、グローバルディレクトリを変更する。 + + {scope} が指定された場合、指定されたスコープの現在の作業ディレ + クトリを変更する: + "window" ウィンドウローカルディレクトリを変更する。 + |:lcd| + "tabpage" タブページローカルディレクトリを変更する。 + |:tcd| + "global" グローバルディレクトリを変更する。 |:cd| + {dir}は文字列でなければならない。 - 現在の作業ディレクトリを {dir} に変更する。ディレクトリの変更 - 範囲は、カレントウィンドウのディレクトリによって異なる: - - カレントウィンドウにウィンドウローカルディレクトリ - (|:lcd|)がある場合は、ウィンドウローカルディレクトリ - を変更する。 - - それ以外の場合、カレントタブページにローカルディレク - トリ(|:tcd|)がある場合は、タブページのローカルディレ - クトリを変更する。 - - それ以外の場合、グローバルディレクトリを変更する。 成功した場合は、前の作業ディレクトリを返す。ディレクトリを復元 するには、これを別の chdir() に渡すこと。 失敗した場合は、空の文字列を返す。 @@ -12091,6 +12100,11 @@ wildtrigger() *wildtrigger()* 通常の履歴ナビゲーションを維持するには (上/下キー): > cnoremap cnoremap +< + 検索を実行するときにオプションを具体的に設定するには、例えば、 + 'pumheights' を設定する: > + autocmd CmdlineEnter [/\?] set pumheight=8 + autocmd CmdlineLeave [/\?] set pumheight& < 戻り値は常に 0 である。 diff --git a/en/builtin.txt b/en/builtin.txt index 02264ea4e..f4409f39a 100644 --- a/en/builtin.txt +++ b/en/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 06 +*builtin.txt* For Vim version 9.1. Last change: 2025 Aug 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1783,16 +1783,23 @@ charidx({string}, {idx} [, {countcc} [, {utf16}]]) Return type: |Number| -chdir({dir}) *chdir()* - Change the current working directory to {dir}. The scope of - the directory change depends on the directory of the current - window: - - If the current window has a window-local directory - (|:lcd|), then changes the window local directory. - - Otherwise, if the current tabpage has a local - directory (|:tcd|) then changes the tabpage local - directory. - - Otherwise, changes the global directory. +chdir({dir} [, {scope}]) *chdir()* + Changes the current working directory to {dir}. The scope of + the change is determined as follows: + If {scope} is not present, the current working directory is + changed to the scope of the current directory: + - If the window local directory (|:lcd|) is set, it + changes the current working directory for that scope. + - Otherwise, if the tab page local directory (|:tcd|) is + set, it changes the current directory for that scope. + - Otherwise, changes the global directory for that scope. + + If {scope} is present, changes the current working directory + for the specified scope: + "window" Changes the window local directory. |:lcd| + "tabpage" Changes the tab page local directory. |:tcd| + "global" Changes the global directory. |:cd| + {dir} must be a String. If successful, returns the previous working directory. Pass this to another chdir() to restore the directory. @@ -12353,6 +12360,11 @@ wildtrigger() *wildtrigger()* To retain normal history navigation (up/down keys): > cnoremap cnoremap +< + To set an option specifically when performing a search, e.g. + to set 'pumheight': > + autocmd CmdlineEnter [/\?] set pumheight=8 + autocmd CmdlineLeave [/\?] set pumheight& < Return value is always 0.