t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 111 forks source link

Yanking into / register should set the search pattern #1091

Open romgrk opened 6 years ago

romgrk commented 6 years ago

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

t9md commented 6 years ago

I understand your intention, but " / y i w" really save yankedinner-wordto/` 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?

romgrk commented 6 years ago

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?