|
1 |
| -*options.txt* For Vim version 9.1. Last change: 2024 Oct 22 |
| 1 | +*options.txt* For Vim version 9.1. Last change: 2024 Nov 06 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar
|
@@ -439,10 +439,11 @@ Note: In the future more global options can be made |global-local|. Using
|
439 | 439 | ":setlocal" on a global option might work differently then.
|
440 | 440 |
|
441 | 441 | *option-value-function*
|
442 |
| -Some options ('completefunc', 'imactivatefunc', 'imstatusfunc', 'omnifunc', |
443 |
| -'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') are set to |
444 |
| -a function name or a function reference or a lambda function. When using a |
445 |
| -lambda it will be converted to the name, e.g. "<lambda>123". Examples: |
| 442 | +Some options ('completefunc', 'findfunc', 'imactivatefunc', 'imstatusfunc', |
| 443 | +'omnifunc', 'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') |
| 444 | +are set to a function name or a function reference or a lambda function. When |
| 445 | +using a lambda it will be converted to the name, e.g. "<lambda>123". |
| 446 | +Examples: |
446 | 447 | >
|
447 | 448 | set opfunc=MyOpFunc
|
448 | 449 | set opfunc=function('MyOpFunc')
|
@@ -3514,7 +3515,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
3514 | 3515 | Only alphanumeric characters, '-' and '_' can be used.
|
3515 | 3516 |
|
3516 | 3517 | *'fillchars'* *'fcs'*
|
3517 |
| -'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~") |
| 3518 | +'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~,lastline:@") |
3518 | 3519 | global or local to window |global-local|
|
3519 | 3520 | Characters to fill the statuslines, vertical separators and special
|
3520 | 3521 | lines in the window.
|
@@ -3552,50 +3553,55 @@ A jump table for the options with a short description can be found at |Q_op|.
|
3552 | 3553 | eob EndOfBuffer |hl-EndOfBuffer|
|
3553 | 3554 | lastline NonText |hl-NonText|
|
3554 | 3555 |
|
3555 |
| - *'findexpr'* *'fexpr'* *E1514* |
3556 |
| -'findexpr' 'fexpr' string (default "") |
| 3556 | + *'findfunc'* *'ffu'* *E1514* |
| 3557 | +'findfunc' 'ffu' string (default empty) |
3557 | 3558 | global or local to buffer |global-local|
|
3558 | 3559 | {not available when compiled without the |+eval|
|
3559 | 3560 | feature}
|
3560 |
| - Expression that is evaluated to obtain the filename(s) for the |:find| |
| 3561 | + Function that is called to obtain the filename(s) for the |:find| |
3561 | 3562 | command. When this option is empty, the internal |file-searching|
|
3562 | 3563 | mechanism is used.
|
3563 | 3564 |
|
3564 |
| - While evaluating the expression, the |v:fname| variable is set to the |
3565 |
| - argument of the |:find| command. |
| 3565 | + The value can be the name of a function, a |lambda| or a |Funcref|. |
| 3566 | + See |option-value-function| for more information. |
3566 | 3567 |
|
3567 |
| - The expression is evaluated only once per |:find| command invocation. |
3568 |
| - The expression can process all the directories specified in 'path'. |
| 3568 | + The function is called with two arguments. The first argument is a |
| 3569 | + |String| and is the |:find| command argument. The second argument is |
| 3570 | + a |Boolean| and is set to |v:true| when the function is called to get |
| 3571 | + a List of command-line completion matches for the |:find| command. |
| 3572 | + The function should return a List of strings. |
3569 | 3573 |
|
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 |
| 3574 | + The function is called only once per |:find| command invocation. |
| 3575 | + The function can process all the directories specified in 'path'. |
| 3576 | + |
| 3577 | + If a match is found, the function should return a |List| containing |
| 3578 | + one or more file names. If a match is not found, the function |
3572 | 3579 | should return an empty List.
|
3573 | 3580 |
|
3574 |
| - If any errors are encountered during the expression evaluation, an |
| 3581 | + If any errors are encountered during the function invocation, an |
3575 | 3582 | empty List is used as the return value.
|
3576 | 3583 |
|
3577 |
| - Using a function call without arguments is faster |expr-option-function| |
3578 |
| - |
3579 | 3584 | It is not allowed to change text or jump to another window while
|
3580 |
| - evaluating 'findexpr' |textlock|. |
| 3585 | + executing the 'findfunc' |textlock|. |
3581 | 3586 |
|
3582 | 3587 | This option cannot be set from a |modeline| or in the |sandbox|, for
|
3583 | 3588 | security reasons.
|
3584 | 3589 |
|
3585 | 3590 | Examples:
|
3586 | 3591 | >
|
3587 | 3592 | " Use glob()
|
3588 |
| - func FindExprGlob() |
3589 |
| - return glob(v:fname, v:false, v:true) |
| 3593 | + func FindFuncGlob(cmdarg, cmdcomplete) |
| 3594 | + let pat = a:cmdcomplete ? $'{a:cmdarg}*' : a:cmdarg |
| 3595 | + return glob(pat, v:false, v:true) |
3590 | 3596 | endfunc
|
3591 |
| - set findexpr=FindExprGlob() |
| 3597 | + set findfunc=FindFuncGlob |
3592 | 3598 |
|
3593 | 3599 | " Use the 'git ls-files' output
|
3594 |
| - func FindGitFiles() |
| 3600 | + func FindGitFiles(cmdarg, cmdcomplete) |
3595 | 3601 | let fnames = systemlist('git ls-files')
|
3596 |
| - return fnames->filter('v:val =~? v:fname') |
| 3602 | + return fnames->filter('v:val =~? a:cmdarg') |
3597 | 3603 | endfunc
|
3598 |
| - set findexpr=FindGitFiles() |
| 3604 | + set findfunc=FindGitFiles |
3599 | 3605 | <
|
3600 | 3606 | *'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
|
3601 | 3607 | 'fixendofline' 'fixeol' boolean (default on)
|
|
0 commit comments