mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
feat(defaults): search selection by * and # in visual mode (#18538)
This commit is contained in:
@@ -71,12 +71,18 @@ N Repeat the latest "/" or "?" [count] times in
|
|||||||
Only whole keywords are searched for, like with the
|
Only whole keywords are searched for, like with the
|
||||||
command "/\<keyword\>". |exclusive|
|
command "/\<keyword\>". |exclusive|
|
||||||
'ignorecase' is used, 'smartcase' is not.
|
'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
|
# Same as "*", but search backward. The pound sign
|
||||||
(character 163) also works. If the "#" key works as
|
(character 163) also works. If the "#" key works as
|
||||||
backspace, try using "stty erase <BS>" before starting
|
backspace, try using "stty erase <BS>" before starting
|
||||||
Vim (<BS> is CTRL-H or a real backspace).
|
Vim (<BS> is CTRL-H or a real backspace).
|
||||||
|
*v_#-default*
|
||||||
|
In Visual mode, search backward for the current selection.
|
||||||
|
|default-mappings|
|
||||||
|
|
||||||
*gstar*
|
*gstar*
|
||||||
g* Like "*", but don't put "\<" and "\>" around the word.
|
g* Like "*", but don't put "\<" and "\>" around the word.
|
||||||
|
@@ -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>
|
nnoremap <C-L> <Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>
|
||||||
inoremap <C-U> <C-G>u<C-U>
|
inoremap <C-U> <C-G>u<C-U>
|
||||||
inoremap <C-W> <C-G>u<C-W>
|
inoremap <C-W> <C-G>u<C-W>
|
||||||
|
xnoremap * y/\V<C-R>"<CR>
|
||||||
|
xnoremap # y?\V<C-R>"<CR>
|
||||||
<
|
<
|
||||||
Default Autocommands ~
|
Default Autocommands ~
|
||||||
*default-autocmds*
|
*default-autocmds*
|
||||||
|
@@ -848,6 +848,8 @@ void init_default_mappings(void)
|
|||||||
MODE_NORMAL, true);
|
MODE_NORMAL, true);
|
||||||
add_map((char_u *)"<C-U> <C-G>u<C-U>", MODE_INSERT, 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 *)"<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"
|
// Insert a string in position 'offset' in the typeahead buffer (for "@r"
|
||||||
|
@@ -26,11 +26,9 @@ set sessionoptions+=options
|
|||||||
set viewoptions+=options
|
set viewoptions+=options
|
||||||
set switchbuf=
|
set switchbuf=
|
||||||
|
|
||||||
" Unmap Nvim default mappings.
|
" Clear Nvim default mappings.
|
||||||
unmap Y
|
mapclear
|
||||||
unmap <C-L>
|
mapclear!
|
||||||
iunmap <C-U>
|
|
||||||
iunmap <C-W>
|
|
||||||
|
|
||||||
" Prevent Nvim log from writing to stderr.
|
" Prevent Nvim log from writing to stderr.
|
||||||
let $NVIM_LOG_FILE = exists($NVIM_LOG_FILE) ? $NVIM_LOG_FILE : 'Xnvim.log'
|
let $NVIM_LOG_FILE = exists($NVIM_LOG_FILE) ? $NVIM_LOG_FILE : 'Xnvim.log'
|
||||||
|
@@ -41,10 +41,8 @@ module.nvim_set = (
|
|||||||
module.nvim_argv = {
|
module.nvim_argv = {
|
||||||
module.nvim_prog, '-u', 'NONE', '-i', 'NONE',
|
module.nvim_prog, '-u', 'NONE', '-i', 'NONE',
|
||||||
'--cmd', module.nvim_set,
|
'--cmd', module.nvim_set,
|
||||||
'--cmd', 'unmap Y',
|
'--cmd', 'mapclear',
|
||||||
'--cmd', 'unmap <C-L>',
|
'--cmd', 'mapclear!',
|
||||||
'--cmd', 'iunmap <C-U>',
|
|
||||||
'--cmd', 'iunmap <C-W>',
|
|
||||||
'--embed'}
|
'--embed'}
|
||||||
|
|
||||||
-- Directory containing nvim.
|
-- Directory containing nvim.
|
||||||
|
Reference in New Issue
Block a user