restricted search & replace

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

restricted search & replace

tuxic
Hi,

in a table made pure from ascii :) I want to
replace certain character for all lines but
in a certain column only.

Therefore I have to restrict search and replace
to a certain range of colums (vim context not table context).

How can I do that?

Thank you very much for any help in advance. :)

Cheers
Meino


--
--
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: restricted search & replace

Tony Mechelynck
On Wed, Jul 25, 2018 at 5:20 AM,  <[hidden email]> wrote:

> Hi,
>
> in a table made pure from ascii :) I want to
> replace certain character for all lines but
> in a certain column only.
>
> Therefore I have to restrict search and replace
> to a certain range of colums (vim context not table context).
>
> How can I do that?
>
> Thank you very much for any help in advance. :)
>
> Cheers
> Meino

Dr. Charles "Chip" Campbell's vis.vim "Visual Block Commands" script
might interest you, but don't take my word for it: go to one of the
pages below, look at the description, and see if it can help you.
"Stable" version: http://vim.sourceforge.net/scripts/script.php?script_id=1195
"Development" version: http://www.drchip.org/astronaut/vim/#VIS

Best regards,
Tony.

--
--
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: restricted search & replace

Lifepillar
In reply to this post by tuxic
On 25/07/2018 05:20, [hidden email] wrote:

> Hi,
>
> in a table made pure from ascii :) I want to
> replace certain character for all lines but
> in a certain column only.
>
> Therefore I have to restrict search and replace
> to a certain range of colums (vim context not table context).
>
> How can I do that?

See :help \%c, \%<c and \%>c. For instance, /\%>7cX\%<13c/ will
match a sequence of X's, but only between column 8 and 11. So,
s/\%>7cX\%<13c/Y/g will replace the X's with Y's.

Hope this helps,
Life.

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