Tuesday, July 24, 2018

Re: restricted search & replace

On 25/07/2018 05:20, tuxic@posteo.de 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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: