atom-vim-mode-plus icon indicating copy to clipboard operation
atom-vim-mode-plus copied to clipboard

Yanking into / register should set the search pattern

Open romgrk opened this issue 7 years ago • 2 comments

In vim: |word some word Typing "/yiwn would put the cursor on the second word.

romgrk avatar Aug 07 '18 19:08 romgrk

I understand your intention, but " / y i w" really save yanked inner-word to/` register?

I tried, but couldn't.

I could successfully put it when I did let @/ = "word" from the command(:) mode. What version of vim, what OS are you using?

t9md avatar Aug 08 '18 00:08 t9md

My bad, it indeed doesn't work in vim. I have a mapping that looks like this:

map  <Plug>(yank-plaintext)  :<C-u>call setreg(v:register, searchPattern#EscapeText(visual#GetText()))<CR>
nmap z*                      viw"/<Plug>(yank-plaintext)

So it's actually using command mode as well.

But can we implement it in VMP anyway?

romgrk avatar Aug 08 '18 16:08 romgrk