Friday, September 17, 2010

Re: Finding Text In Specific Columns

On Wed, Sep 15, 2010 at 11:11, Christian Brabandt <cblists@256bit.org> wrote:
Hi Stephen!

[Please don't top poste]

Sorry, I was just following the lead set in the thread.
 

On Mi, 15 Sep 2010, Stephen Rasku wrote:

> OK, I got something working.  I used the following:
>
>     :let m = matchadd('ErrorMsg','^\%(\%([^\t]\{7}\)\zs[^0]\)\{1}')
>     ...
>     :let m = matchadd('ErrorMsg','^\%(\%([^\t]\{7}\)\zs[^0]\)\{32}')
>
> This requires entering a similar pattern 32 times which is error
> prone.  If I forget to add just a single pattern then I won't see a
> highlight for that column.  Is there a better way to do this?  I tried
> specifying \{1,32} but this always matches the last (i.e. 256th)
> character on the line.

Did you try this, without anchoring the match to the line start?

This doesn't work.  It finds every 8 characters that's not a zero but they are not on position 8,16,24, etc.


> In addition, I would like to be able to search for the "errors".
> There's over four thousand lines in the file so scrolling through the
> file looking for one red character is tedious.  Is there a good way to
> do this?

Can't you simply use the above pattern for searching, or am I missing
something?


Unfortunately, I would have to enter the search pattern 32 times which is error prone and tedious.

...Stephen

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

No comments:

Post a Comment