Skip to content

Commit ffeffcb

Browse files
fmoralescjustinmk
authored andcommitted
defaults: enable 'incsearch' by default. #2858
This also updates the documentation about 'incsearch'. Re: #2676
1 parent 6cfe98c commit ffeffcb

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

runtime/doc/options.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3785,10 +3785,8 @@ A jump table for the options with a short description can be found at |Q_op|.
37853785
evaluating 'includeexpr' |textlock|.
37863786

37873787
*'incsearch'* *'is'* *'noincsearch'* *'nois'*
3788-
'incsearch' 'is' boolean (default off)
3788+
'incsearch' 'is' boolean (default on)
37893789
global
3790-
{not available when compiled without the
3791-
|+extra_search| features}
37923790
While typing a search command, show where the pattern, as it was typed
37933791
so far, matches. The matched string is highlighted. If the pattern
37943792
is invalid or not found, nothing is shown. The screen will be updated
@@ -3797,10 +3795,9 @@ A jump table for the options with a short description can be found at |Q_op|.
37973795
original position when no match is found and when pressing <Esc>. You
37983796
still need to finish the search command with <Enter> to move the
37993797
cursor to the match.
3800-
When compiled with the |+reltime| feature Vim only searches for about
3801-
half a second. With a complicated pattern and/or a lot of text the
3802-
match may not be found. This is to avoid that Vim hangs while you
3803-
are typing the pattern.
3798+
Vim only searches for about half a second. With a complicated
3799+
pattern and/or a lot of text the match may not be found. This is to
3800+
avoid that Vim hangs while you are typing the pattern.
38043801
The highlighting can be set with the 'i' flag in 'highlight'.
38053802
See also: 'hlsearch'.
38063803
CTRL-L can be used to add one character from after the current match

runtime/doc/usr_03.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,18 +450,17 @@ TUNING SEARCHES
450450

451451
There are a few options that change how searching works. These are the
452452
essential ones:
453-
>
454-
:set incsearch
455-
456-
This makes Vim display the match for the string while you are still typing it.
457-
Use this to check if the right match will be found. Then press <Enter> to
458-
really jump to that location. Or type more to change the search string.
459453
>
460454
:set nowrapscan
461455
462456
This stops the search at the end of the file. Or, when you are searching
463457
backwards, at the start of the file. The 'wrapscan' option is on by default,
464458
thus searching wraps around the end of the file.
459+
>
460+
:set noincsearch
461+
462+
This disables the display of the matches while you are still typing your
463+
search.
465464

466465

467466
INTERMEZZO

runtime/doc/usr_05.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ For MS-DOS and MS-Windows you can use one of these:
4949

5050
The vimrc file can contain all the commands that you type after a colon. The
5151
most simple ones are for setting options. For example, if you want Vim to
52-
always start with the 'incsearch' option on, add this line your vimrc file: >
52+
always start with the 'ignorecase' option on, add this line your vimrc file: >
5353
54-
set incsearch
54+
set ignorecase
5555
5656
For this new line to take effect you need to exit Vim and start it again.
5757
Later you will learn how to do this without exiting Vim.

runtime/doc/vim_diff.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ these differences.
3434
- 'complete' doesn't include "i"
3535
- 'encoding' defaults to "utf-8"
3636
- 'formatoptions' defaults to "tcqj"
37+
- 'incsearch' is set by default
3738
- 'langnoremap' is set by default
3839
- 'mouse' defaults to "a"
3940
- 'nocompatible' is always set

src/nvim/option.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,9 +934,9 @@ static vimoption_T
934934
(char_u *)&p_inex, PV_INEX,
935935
{(char_u *)"", (char_u *)0L}
936936
SCRIPTID_INIT},
937-
{"incsearch", "is", P_BOOL|P_VI_DEF|P_VIM,
937+
{"incsearch", "is", P_BOOL|P_VIM,
938938
(char_u *)&p_is, PV_NONE,
939-
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
939+
{(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT},
940940
{"indentexpr", "inde", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM,
941941
(char_u *)&p_inde, PV_INDE,
942942
{(char_u *)"", (char_u *)0L}

0 commit comments

Comments
 (0)