defaults: enable 'incsearch' by default. #2858

This also updates the documentation about 'incsearch'.

Re: https://github.com/neovim/neovim/issues/2676
This commit is contained in:
Felipe Morales
2015-06-18 23:02:36 -03:00
committed by Justin M. Keyes
parent 6cfe98c66e
commit ffeffcb6cd
5 changed files with 14 additions and 17 deletions

View File

@@ -3785,10 +3785,8 @@ A jump table for the options with a short description can be found at |Q_op|.
evaluating 'includeexpr' |textlock|.
*'incsearch'* *'is'* *'noincsearch'* *'nois'*
'incsearch' 'is' boolean (default off)
'incsearch' 'is' boolean (default on)
global
{not available when compiled without the
|+extra_search| features}
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
@@ -3797,10 +3795,9 @@ A jump table for the options with a short description can be found at |Q_op|.
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.
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.
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'.
See also: 'hlsearch'.
CTRL-L can be used to add one character from after the current match

View File

@@ -450,18 +450,17 @@ TUNING SEARCHES
There are a few options that change how searching works. These are the
essential ones:
>
:set incsearch
This makes Vim display the match for the string while you are still typing it.
Use this to check if the right match will be found. Then press <Enter> to
really jump to that location. Or type more to change the search string.
>
:set nowrapscan
This stops the search at the end of the file. Or, when you are searching
backwards, at the start of the file. The 'wrapscan' option is on by default,
thus searching wraps around the end of the file.
>
:set noincsearch
This disables the display of the matches while you are still typing your
search.
INTERMEZZO

View File

@@ -49,9 +49,9 @@ For MS-DOS and MS-Windows you can use one of these:
The vimrc file can contain all the commands that you type after a colon. The
most simple ones are for setting options. For example, if you want Vim to
always start with the 'incsearch' option on, add this line your vimrc file: >
always start with the 'ignorecase' option on, add this line your vimrc file: >
set incsearch
set ignorecase
For this new line to take effect you need to exit Vim and start it again.
Later you will learn how to do this without exiting Vim.

View File

@@ -34,6 +34,7 @@ these differences.
- 'complete' doesn't include "i"
- 'encoding' defaults to "utf-8"
- 'formatoptions' defaults to "tcqj"
- 'incsearch' is set by default
- 'langnoremap' is set by default
- 'mouse' defaults to "a"
- 'nocompatible' is always set

View File

@@ -934,9 +934,9 @@ static vimoption_T
(char_u *)&p_inex, PV_INEX,
{(char_u *)"", (char_u *)0L}
SCRIPTID_INIT},
{"incsearch", "is", P_BOOL|P_VI_DEF|P_VIM,
{"incsearch", "is", P_BOOL|P_VIM,
(char_u *)&p_is, PV_NONE,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT},
{"indentexpr", "inde", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM,
(char_u *)&p_inde, PV_INDE,
{(char_u *)"", (char_u *)0L}