mv ~/.vimrc ~/vimrc
mv ~/.vim vim
vim
:set incsearch
insert two lines:
one
two
put cursor on word "one", type /^ to get into search mode, Ctrl-R Ctrl-W, word "two" will be inserted into command line
Word under cursor is expected to be inserted ("one"). If I remove :set incsearch step, all works as expected. According to #vim@libera bug is not present in 3455.
I use this method to quickly navigate through code, because '^func_name' will immediately gets me to its implementation.
vim-8.2.4476-no_x11
OpenBSD current
xterm
screen-256color
ksh
No response
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.
Isn't this expected? With /^ you search for a begin-of-word. Help for c_CTRL-R_CTRL-W says:
When 'incsearch' is set the cursor position at the end of the
currently displayed match is used. With CTRL-W the part of
the word that was already typed is not inserted again.
IOW, with 'incsearch'
on, you start at the beginning of the next Word from the cursor — or at least that's how I understand it.
What happens if instead of /^
you go into search mode with only /
? Or if instead of /^
(search forward) you use ?^
(search back)?
Best regards,
Tony.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Oops, ^ is begin-of-line, not begin-of-word. But otherwise I think my reasoning holds.
Best regards,
Tony.
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.
Isn't this expected? With /^ you search for a begin-of-word. Help for c_CTRL-R_CTRL-W says:
When 'incsearch' is set the cursor position at the end of the currently displayed match is used. With CTRL-W the part of the word that was already typed is not inserted again.
IOW, with
'incsearch'
on, you start at the beginning of the next Word from the cursor — or at least that's how I understand it.
Does it mean that ^ in /^ is interpreted as 'part of the word'?
I mean in following scenario it makes sense:
fooa
foob
set cursor on first line, type /foo it will auto-complete to /foob. I see how it makes sense for words, but I expected ^ to be interpreted in other, "special", way. (I illustrated workflow in which it makes sense in OP).
What happens if instead of
/^
you go into search mode with only/
? Or if instead of/^
(search forward) you use?^
(search back)?
If i use /
- it works as expected, it pastes word under cursor.
If i use ?^
and i'm on first line, i see E348: No string under cursor
, if i'm on second line it pastes one
.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
When you type "^" the cursor moves to the start of the next line. You can't see it, since it doesn't match any character yet. Try typing "." and you see the "t" of "two" is highlighted.
This is normal behavior, "^" searches for the next start of the line, so that is where the cursor is when you type CTRL-R CTRL-W
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.
Closed #9898.
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.