Wednesday, September 15, 2010

Re: Finding Text In Specific Columns

Hi Stephen!

[Please don't top poste]

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?

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

regards,
Christian

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