aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/options.txt2
-rw-r--r--runtime/doc/usr_03.txt13
-rw-r--r--runtime/doc/usr_26.txt2
-rw-r--r--runtime/doc/vim_diff.txt1
-rw-r--r--src/nvim/option.c4
-rw-r--r--test/functional/ui/searchhl_spec.lua6
6 files changed, 15 insertions, 13 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 9ea14af197..71c2ba13d3 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3539,7 +3539,7 @@ A jump table for the options with a short description can be found at |Q_op|.
See |highlight-default| for the default highlight groups.
*'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'*
-'hlsearch' 'hls' boolean (default off)
+'hlsearch' 'hls' boolean (default on)
global
{not available when compiled without the
|+extra_search| feature}
diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt
index 411e88684c..9de9eb380c 100644
--- a/runtime/doc/usr_03.txt
+++ b/runtime/doc/usr_03.txt
@@ -426,18 +426,19 @@ HIGHLIGHTING MATCHES
While editing a program you see a variable called "nr". You want to check
where it's used. You could move the cursor to "nr" and use the "*" command
and press "n" to go along all the matches.
- There is another way. Type this command: >
- :set hlsearch
-
-If you now search for "nr", Vim will highlight all matches. That is a very
-good way to see where the variable is used, without the need to type commands.
+Vim will highlight all matches. That is a very good way to see where the
+variable is used, without the need to type commands.
To switch this off: >
:set nohlsearch
Then you need to switch it on again if you want to use it for the next search
-command. If you only want to remove the highlighting, use this command: >
+command: >
+
+ :set hlsearch
+
+If you only want to remove the highlighting, use this command: >
:nohlsearch
diff --git a/runtime/doc/usr_26.txt b/runtime/doc/usr_26.txt
index 6a4a375582..e381a1df12 100644
--- a/runtime/doc/usr_26.txt
+++ b/runtime/doc/usr_26.txt
@@ -64,8 +64,6 @@ Now press CTRL-A. The year will be increased by one:
Use "n" to find the next year, and press "." to repeat the CTRL-A ("." is a
bit quicker to type). Repeat "n" and "." for all years that appear.
- Hint: set the 'hlsearch' option to see the matches you are going to change,
-then you can look ahead and do it faster.
Adding more than one can be done by prepending the number to CTRL-A. Suppose
you have this list:
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 37c0aa9e7a..0f32e1ea64 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -34,6 +34,7 @@ these differences.
- 'complete' doesn't include "i"
- 'encoding' defaults to "utf-8"
- 'formatoptions' defaults to "tcqj"
+- 'hlsearch' is set by default
- 'incsearch' is set by default
- 'langnoremap' is set by default
- 'mouse' defaults to "a"
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 0ee8fc19b4..9eb581909e 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -880,9 +880,9 @@ static vimoption_T
{"hkmapp", "hkp", P_BOOL|P_VI_DEF|P_VIM,
(char_u *)&p_hkmapp, PV_NONE,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
- {"hlsearch", "hls", P_BOOL|P_VI_DEF|P_VIM|P_RALL,
+ {"hlsearch", "hls", P_BOOL|P_VIM|P_RALL,
(char_u *)&p_hls, PV_NONE,
- {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
+ {(char_u *)FALSE, (char_u *)TRUE} SCRIPTID_INIT},
{"icon", NULL, P_BOOL|P_VI_DEF,
(char_u *)&p_icon, PV_NONE,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index 7bc66942cb..d04329e1e2 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -25,7 +25,8 @@ describe('search highlighting', function()
screen:set_default_attr_ignore( {{bold=true, foreground=hl_colors.NonText}} )
end)
- it('is off by default', function()
+ it('is disabled by ":set nohlsearch"', function()
+ execute('set nohlsearch')
insert("some text\nmore text")
feed("gg/text<cr>")
screen:expect([[
@@ -40,13 +41,14 @@ describe('search highlighting', function()
end)
it('works', function()
- execute('set hlsearch')
insert([[
some text
more textstuff
stupidtexttextstuff
a text word
]])
+
+ -- 'hlsearch' is enabled by default. #2859
feed("gg/text<cr>")
screen:expect([[
some {1:^text} |