Skip to content

Commit f813a49

Browse files
committed
Update by original
1 parent 1dc0989 commit f813a49

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

doc/options.jax

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3575,6 +3575,46 @@ Note 1番目の形式では、行全体がオプション指定に使われる
35753575
eob EndOfBuffer |hl-EndOfBuffer|
35763576
lastline NonText |hl-NonText|
35773577

3578+
*'findexpr'* *'fexpr'*
3579+
'findexpr' 'fexpr' 文字列 (既定では "")
3580+
グローバル/バッファについてローカル |local-noglobal|
3581+
{|+eval| 機能つきでコンパイルされたときのみ有効}
3582+
|:find| コマンドのファイル名を取得するために評価される式。このオプショ
3583+
ンが空の場合、内部の |file-searching| メカニズムが使用される。
3584+
3585+
式の評価中、|v:fname| 変数は |:find| コマンドの引数に設定される。
3586+
3587+
式は、|:find| コマンドの呼び出しごとに 1 回だけ評価される。
3588+
式は、'path' で指定されたすべてのディレクトリを処理できる。
3589+
3590+
マッチした場合、式は 1 つ以上のファイル名を含む |List| を返す必要があ
3591+
る。マッチしない場合、式は空のリストを返す必要がある。
3592+
3593+
式の評価中にエラーが発生した場合、空のリストが戻り値として使用される。
3594+
3595+
引数なしの関数呼び出しを使用すると高速になる |expr-option-function|
3596+
3597+
'findexpr' の評価中にテキストを変更したり、別のウィンドウにジャンプし
3598+
たりすることはできない。|textlock|
3599+
3600+
セキュリティ上の理由から、このオプションを |modeline| または |sandbox|
3601+
内で設定することはできない。
3602+
3603+
例:
3604+
>
3605+
" glob() を使う
3606+
func FindExprGlob()
3607+
return glob(v:fname, v:false, v:true)
3608+
endfunc
3609+
set findexpr=FindExprGlob()
3610+
3611+
" 'git ls-files' の出力を使う
3612+
func FindGitFiles()
3613+
let fnames = systemlist('git ls-files')
3614+
return fnames->filter('v:val =~? v:fname')
3615+
endfunc
3616+
set findexpr=FindGitFiles()
3617+
<
35783618
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
35793619
'fixendofline' 'fixeol' 切替 (既定ではオン)
35803620
バッファについてローカル

en/options.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3552,6 +3552,51 @@ A jump table for the options with a short description can be found at |Q_op|.
35523552
eob EndOfBuffer |hl-EndOfBuffer|
35533553
lastline NonText |hl-NonText|
35543554

3555+
*'findexpr'* *'fexpr'*
3556+
'findexpr' 'fexpr' string (default "")
3557+
global or local to buffer |global-local|
3558+
{not available when compiled without the |+eval|
3559+
feature}
3560+
Expression that is evaluated to obtain the filename(s) for the |:find|
3561+
command. When this option is empty, the internal |file-searching|
3562+
mechanism is used.
3563+
3564+
While evaluating the expression, the |v:fname| variable is set to the
3565+
argument of the |:find| command.
3566+
3567+
The expression is evaluated only once per |:find| command invocation.
3568+
The expression can process all the directories specified in 'path'.
3569+
3570+
If a match is found, the expression should return a |List| containing
3571+
one or more file names. If a match is not found, the expression
3572+
should return an empty List.
3573+
3574+
If any errors are encountered during the expression evaluation, an
3575+
empty List is used as the return value.
3576+
3577+
Using a function call without arguments is faster |expr-option-function|
3578+
3579+
It is not allowed to change text or jump to another window while
3580+
evaluating 'findexpr' |textlock|.
3581+
3582+
This option cannot be set from a |modeline| or in the |sandbox|, for
3583+
security reasons.
3584+
3585+
Examples:
3586+
>
3587+
" Use glob()
3588+
func FindExprGlob()
3589+
return glob(v:fname, v:false, v:true)
3590+
endfunc
3591+
set findexpr=FindExprGlob()
3592+
3593+
" Use the 'git ls-files' output
3594+
func FindGitFiles()
3595+
let fnames = systemlist('git ls-files')
3596+
return fnames->filter('v:val =~? v:fname')
3597+
endfunc
3598+
set findexpr=FindGitFiles()
3599+
<
35553600
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
35563601
'fixendofline' 'fixeol' boolean (default on)
35573602
local to buffer

0 commit comments

Comments
 (0)