Monday, January 30, 2017

Re: horizontal range, kindof

BPJ wrote:
> I'm trying to do a substitution in a 'horizontal/virtual column range'.
>
> I have an ASCII table where the columns are separated by tab
> characters (for now). I want to wrap the contents (which contain
> space (U+0020) and \S characters, being of unequal length of
> course!) of some specific table columns in asterisks (think
> Markdown emphasis). I thought I could use a range and \%v to
> match the text between two screen virtual columns and then use an
> expression with substitute() to wrap instances of \T\+
> inside the matched screen column range, something like
>
> 'a,'b s/\%13v.*\%46v/\=substitute(submatch(0),'\T\+','*&*','g')/
>
> but apparently I've misunderstood \%v because I get no match.
> So what is the right way to do this? I'm not looking forward to
> changing three columns on some 70 lines manually!
>
You might be able to make use of vis.vim
(http://www.drchip.org/astronaut/vim/index.html#VIS) where you define a
region using visual-block mode (ctrl-v, move) and a :B command.

You might find Christian Brabandt's nrrwregion plugin of use (search for
it on http://vim.sf.net).

Regards,
Chip Campbell

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