-*options.txt* For Vim version 9.2. Last change: 2026 Feb 17
+*options.txt* For Vim version 9.2. Last change: 2026 Feb 21
VIM REFERENCE MANUAL by Bram Moolenaar
fuzzy Enable |fuzzy-matching| for completion candidates. This
allows for more flexible and intuitive matching, where
characters can be skipped and matches can be found even
- if the exact sequence is not typed.
+ if the exact sequence is not typed (disabled for thesaurus
+ completion |compl-thesaurus|).
longest
When 'autocomplete' is not active, only the longest common
- prefix of the matches is inserted. If the popup menu is
+ prefix of the matches is inserted (disabled for thesaurus
+ completion |compl-thesaurus|). If the popup menu is
displayed, you can use CTRL-L to add more characters.
Whether case is ignored depends on the type of completion.
For buffer text the 'ignorecase' option applies.
static int
cot_fuzzy(void)
{
- return (get_cot_flags() & COT_FUZZY) != 0;
+ return (get_cot_flags() & COT_FUZZY) != 0 && !ctrl_x_mode_thesaurus();
}
/*
// Find the longest common string if still doing that.
if (compl_get_longest && (flags & CP_ORIGINAL_TEXT) == 0 && !cot_fuzzy()
- && !ins_compl_preinsert_longest())
+ && !ins_compl_preinsert_longest() && !ctrl_x_mode_thesaurus())
ins_compl_longest_match(match);
return OK;
bw!
endfunc
-func Test_edit_CTRL_T()
+func Edit_CTRL_T()
" Check for CTRL-T and CTRL-X CTRL-T in insert mode
" 1) increase indent
new
bw!
endfunc
+func Test_edit_CTRL_T()
+ call Edit_CTRL_T()
+ set completeopt+=fuzzy
+ call Edit_CTRL_T()
+ set completeopt&
+endfunc
+
+func Test_edit_CTRL_T_longest()
+ " CTRL-X CTRL-T (thesaurus complete) with 'longest' should not insert
+ " longest match
+ set completeopt+=longest
+ new
+ call writefile(['angry furious mad madder maddest'], 'Xthesaurus', 'D')
+ set thesaurus=Xthesaurus
+ call setline(1, 'mad')
+ call cursor(1, 1)
+ call feedkeys("A\<c-x>\<c-t>\<cr>\<esc>", 'tnix')
+ call assert_equal(['mad', ''], getline(1, '$'))
+ bw!
+ set thesaurus=
+ set completeopt&
+endfunc
+
" Test thesaurus completion with different encodings
func Test_thesaurus_complete_with_encoding()
call writefile(['angry furious mad enraged'], 'Xthesaurus', 'D')
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 36,
/**/
35,
/**/