new behavior of substitute command

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

new behavior of substitute command

Alessandro Antonello
Hi, all.

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.

I already searched the help but didn't found a way to get the old behavior. Is that possible?

Thanks in advance.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: new behavior of substitute command

Christian Brabandt

On So, 09 Dez 2018, Alessandro Antonello wrote:

> Hi, all.
>
> 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.
>
> I already searched the help but didn't found a way to get the old
> behavior. Is that possible?

:set noincsearch

Best,
Christian
--
Wie man sein Kind nicht nennen sollte:
  Mel Sack

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: new behavior of substitute command

Bram Moolenaar
In reply to this post by Alessandro Antonello

Alessandro Antonello 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.

You mean CTRL-R CTRL-W.

> I already searched the help but didn't found a way to get the old behavior.
> Is that possible?

You can type it before any other text.  If you want to insert something
before it,  you'll have to use the cursor to move back to before the
word.

On the other hand, you can now type a few letters to pick up another
word.

--
Team-building exercises come in many forms but they all trace their roots back
to the prison system.  In your typical team-building exercise the employees
are subjected to a variety of unpleasant situations until they become either a
cohesive team or a ring of car jackers.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
A S
Reply | Threaded
Open this post in threaded view
|

Re: new behavior of substitute command

A S
In reply to this post by Christian Brabandt
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

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: new behavior of substitute command

Alessandro Antonello


Em qua, 12 de dez de 2018 às 19:09, AS <[hidden email]> 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 [hidden email].
For more options, visit https://groups.google.com/d/optout.