Gary Johnson <[email protected]> [09-08-14 01:40]:
>
> On 2009-08-13, [email protected] wrote:
> > Hi,
> >
> > A tool generates a file as output, which has keywords inside of the
> > pattern:
> >
> > A-<keywords> <floating point value n>
> > (some other keywords)
> > B-<keywords> <floating point value n>
> >
> > It is always a pair and there a lot of pairs with different <keyword>s
> >
> > With "*" or "#" I can search for the _same_ matching keyword up and
> > down. Now I want to use another lowercase key to jump between both
> > parts of a pair. That is: When the cursor is on
> >
> > A-<keywords> <floating point value n>
> >
> > I want to jump to
> >
> > B-<keywords> <floating point value n>
> >
> > and vice versa wihouth modyfing anything, since I need to quick
> > compare the floating point values.
> >
> > I _know_ that there is no "this does not work with vim" but
> > for sure I know that I dont know how.
> >
> > Thank you very much for any part of the puzzle in advance!
>
> Just load the matchit.vim plugin, if you don't have it loaded
> already (see ":help matchit"), and execute this:
>
> let b:match_words = '^A\>:^B\>'
>
> You could put that line in the filetype plugin for your tool's
> output file. Then % will jump between A and B just as it does for
> parentheses and other pairs of symbols. Note that I've anchored A
> and B to column 1.
>
> Regards,
> Gary
>
Hi Gary.
there one little problem left...
Matchit was build to match pairs, which enclose "blocks": That is:
there is a begin-of-block marker and a end-of-block marker and
tose marker and build different levels.
My case is a little different: I only want to match according to
keywords. There is only a pair of A-<keyword> and B-<keyword> and
others, totally unrelated pairs of A-<another keyword> and B-<another
keyword>.
Transformed this back to curly braces, braces, square braces and
brackets, the following would be a total syntactical correct
example:
]
(
[
}
{
)
If the cursor is on ')' it should match '(' below and back.
And so forth with the other pairs.
No levels, no hierachies -- only pairs and only two of the same
kind.
Currently I only can use matchit, when the cursor is on A-<keyword>
and can jump down to B-<keyword> and back.
If B-<keyword> is the first and A-<keyword> in lines below this,
matchit """fails""", since it thinks in levels and hierachies.
I am lost here, I think, am I ?
Have a nice weekend !
mcc
--
Please don't send me any Word- or Powerpoint-Attachments
unless it's absolutely neccessary. - Send simply Text.
See http://www.gnu.org/philosophy/no-word-attachments.html
In a world without fences and walls nobody needs gates and windows.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---