Wednesday, December 19, 2018

Re: new behavior of substitute command



Em qua, 12 de dez de 2018 às 19:09, AS <097115@gmail.com> escreveu:
On Monday, December 10, 2018 at 9:21:31 AM UTC+2, Christian Brabandt wrote:
> > I'm using MacVim 8.1, patches 1-560 and I notice a change in the
> > behavior of substitution command. Now it starts to search for text as
> > I type it in the command bar, as of the search command. This is good
> > but I lost the possibility to use the keys <C-R>-w to copy word under
> > cursor to be replaced.
> :set noincsearch

Am I missing something? I :set incsearch and still perfectly capable of using <C-r><C-w> while in the command line editing the substitute command (both for the search and for the replacement patterns). Here's a gif: https://i.imgur.com/E5YRwza.gif

(My Vim is a bit older, 8.1.450, but seems like it shouldn't matter: ftp://ftp.vim.org/pub/vim/patches/8.1/README)


--
AS

Thanks Bram, Christian.

Hi, AS.

Indeed. As Bram wrote, when <C-R><C-W> are the first typed keys, the word under cursor gets inserted.
I am used to type "\<" just before that, to be sure to replace just "that" word. Typing "\<" before <C-R><C-W> doesn't work any more, the cursor will move to another location. But, as Bram wrote, I can type <C-R><C-W> right after typing ":s/". Then, using the arrow keys, I insert the "\<" before and "\>" after to specialize the substitution. That is fine to me. Works perfectly.

Thank you all.


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: