aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/pattern.txt6
-rw-r--r--runtime/doc/vim_diff.txt2
-rw-r--r--src/nvim/getchar.c2
-rw-r--r--src/nvim/testdir/setup.vim8
-rw-r--r--test/functional/helpers.lua6
5 files changed, 15 insertions, 9 deletions
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 35f5b311ff..371a210847 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -71,12 +71,18 @@ N Repeat the latest "/" or "?" [count] times in
Only whole keywords are searched for, like with the
command "/\<keyword\>". |exclusive|
'ignorecase' is used, 'smartcase' is not.
+ *v_star-default*
+ In Visual mode, search forward for the current selection.
+ |default-mappings|
*#*
# Same as "*", but search backward. The pound sign
(character 163) also works. If the "#" key works as
backspace, try using "stty erase <BS>" before starting
Vim (<BS> is CTRL-H or a real backspace).
+ *v_#-default*
+ In Visual mode, search backward for the current selection.
+ |default-mappings|
*gstar*
g* Like "*", but don't put "\<" and "\>" around the word.
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 1a3d6022ca..a3de8c6574 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -87,6 +87,8 @@ of these in your config by simply removing the mapping, e.g. ":unmap Y".
nnoremap <C-L> <Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>
inoremap <C-U> <C-G>u<C-U>
inoremap <C-W> <C-G>u<C-W>
+ xnoremap * y/\V<C-R>"<CR>
+ xnoremap # y?\V<C-R>"<CR>
<
Default Autocommands ~
*default-autocmds*
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index df45de2abf..3c465db4f9 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -848,6 +848,8 @@ void init_default_mappings(void)
MODE_NORMAL, true);
add_map((char_u *)"<C-U> <C-G>u<C-U>", MODE_INSERT, true);
add_map((char_u *)"<C-W> <C-G>u<C-W>", MODE_INSERT, true);
+ add_map((char_u *)"* y/\\\\V<C-R>\"<CR>", MODE_VISUAL, true);
+ add_map((char_u *)"# y?\\\\V<C-R>\"<CR>", MODE_VISUAL, true);
}
// Insert a string in position 'offset' in the typeahead buffer (for "@r"
diff --git a/src/nvim/testdir/setup.vim b/src/nvim/testdir/setup.vim
index 15e3b31498..f1092af358 100644
--- a/src/nvim/testdir/setup.vim
+++ b/src/nvim/testdir/setup.vim
@@ -26,11 +26,9 @@ set sessionoptions+=options
set viewoptions+=options
set switchbuf=
-" Unmap Nvim default mappings.
-unmap Y
-unmap <C-L>
-iunmap <C-U>
-iunmap <C-W>
+" Clear Nvim default mappings.
+mapclear
+mapclear!
" Prevent Nvim log from writing to stderr.
let $NVIM_LOG_FILE = exists($NVIM_LOG_FILE) ? $NVIM_LOG_FILE : 'Xnvim.log'
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index e9c3d4bd92..3d64625752 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -41,10 +41,8 @@ module.nvim_set = (
module.nvim_argv = {
module.nvim_prog, '-u', 'NONE', '-i', 'NONE',
'--cmd', module.nvim_set,
- '--cmd', 'unmap Y',
- '--cmd', 'unmap <C-L>',
- '--cmd', 'iunmap <C-U>',
- '--cmd', 'iunmap <C-W>',
+ '--cmd', 'mapclear',
+ '--cmd', 'mapclear!',
'--embed'}
-- Directory containing nvim.