replace s/ from current cursor position

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

replace s/ from current cursor position

Ni Va
Hi,

In the same line I got these :


 "foo" "bar
bar bar
bar bar bar
"


Would like to replace only "bar......" .


Is it possible with a range just before  s/"\_.\{-}"/"REPLACE"/ ?

Thank you
NiVa

--
--
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: replace s/ from current cursor position

Ben Fritz
On Friday, September 14, 2018 at 10:10:53 AM UTC-5, Ni Va wrote:

> Hi,
>
> In the same line I got these :
>
>
>  "foo" "bar
> bar bar
> bar bar bar
> "
>
>
> Would like to replace only "bar......" .
>
>
> Is it possible with a range just before  s/"\_.\{-}"/"REPLACE"/ ?
>
It is very unclear what you are asking. A before/after text example, plus the current cursor position (if that's actually important to your question) would be helpful.

For now, all I can help with is to say that you can include the current cursor position in a pattern by including '\%#' in the pattern where you want to match the cursor. See ":help /\%#".

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