Thus wrote Peppe paa DTU (c928400@...
) on :
> Thus wrote Zdenek Sekera (zs@...) on :
> > I have a regexp (may be a multiline and lots of times it is) and I need
> > to
> > find the starting point in the file where that regexp matches.
> > That simple enough, however, I need to find it subject to the following
> > condition: the cursor can be at the time of match anywhere in the file
> > and I need to establish if the string matching the regexp can be found
> > such that the cursor is *inside* the matched string (including first and
> > last char of the matched string). And if so return the line and the
> > starting
> > char position of the matched string.
> How about the functions below?
OK, Zdenek and I had a little talk, and I came up with the attached
The aim of the main function is to locate a pattern that includes the
current position and return information about the pattern and/or
This may sound as a strange thing to do, but see the documentation for
an example with HTML.
Btw, I like the idea of eg "dvj", where one uses v, V, or <C-V> to
alter the behaviour of the motion afterwards. But it appears that no
vmap's are carried out for this visual-like selection. Is there a way
around this, or is it intended behaviour? (omaps does not seem to do
the trick :-( ).