import { op } from "https://deno.land/x/ddc_vim@v4.3.0/deps.ts";
const { incsearch } = op;
While typing a search command, show where the pattern, as it was typed so far, matches. The matched string is highlighted. If the pattern is invalid or not found, nothing is shown. The screen will be updated often, this is only useful on fast terminals. Also applies to the pattern in commands:
:global
:lvimgrep
:lvimgrepadd
:smagic
:snomagic
:sort
:substitute
:vglobal
:vimgrep
:vimgrepadd
Note that the match will be shown, but the cursor will return to its
original position when no match is found and when pressing <Esc>
. You
still need to finish the search command with <Enter>
to move the
cursor to the match.
You can use the CTRL-G and CTRL-T keys to move to the next and
previous match. c_CTRL-G
c_CTRL-T
When compiled with the +reltime
feature Vim only searches for about
half a second. With a complicated pattern and/or a lot of text the
match may not be found. This is to avoid that Vim hangs while you
are typing the pattern.
The highlighting can be set with the 'i' flag in 'highlight'.
When 'hlsearch' is on, all matched strings are highlighted too while
typing a search command. See also: 'hlsearch'.
If you don't want to turn 'hlsearch' on, but want to highlight all
matches while searching, you can turn on and off 'hlsearch' with
autocmd. Example:
augroup vimrc-incsearch-highlight
autocmd!
autocmd CmdlineEnter /,\? :set hlsearch
autocmd CmdlineLeave /,\? :set nohlsearch
augroup END
CTRL-L can be used to add one character from after the current match to the command line. If 'ignorecase' and 'smartcase' are set and the command line has no uppercase characters, the added character is converted to lowercase. CTRL-R CTRL-W can be used to add the word at the end of the current match, excluding the characters that were already typed. NOTE: This option is reset when 'compatible' is set.
(default off, set in defaults.vim
if the
+reltime
feature is supported)
not available when compiled without the +extra_search
features