On Jan 5, 10:19 am, "Gowtham M" <[email protected]> wrote:
> Normally '/' in normal mode starts to search for the pattern horizontally
> (line after line, left to right). Is it possible to search text vertically
> (column after column, top to bottom) in vim?
>
> For example, the pattern 01100010 should highlight the second column of the
> below text.
>
> 1001
> 1111
> 1111
> 0011
> 0000
> 0010
> 1111
> 0000
>
> Thanks in advance.
>
> Gowtham

This is not possible in Vim without some scripting or plugins.

I would attack it this way from the scripting side:

1. Create a command that will search for a string in a given column
(not regex probably...that would be really hard...or at least not a
variable length regex)

This command would probably use the \%v zero-width match to match each
character in the string (:help /\%v) and then match something like .*
\n.* between each character.

2. Create a function that will find the max column length in the file,
then loop over every column and call the command created in (1). If
you want to get fancy, you could even have it exclude column numbers
that don't ever have enough contiguous lines of sufficient length to
contain your string.

3. Create a command that will call the function created in (2).

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to