2007/2/8, Marc Weber <[EMAIL PROTECTED]>:
On Thu, Feb 08, 2007 at 01:30:37PM +0100, Thomas Michael Engelke wrote:
> Can anybody give me a hint on how to rewrite the mapping so I get such
> a conext menu instead of a numbered list?

Get the word under the cursor using expand('<cword>')

See completion examples (:h complete-functions) to filter and get the
list. To get the lines you can use getline using with range(0,line('$'))

HTH If you need more info post again.
 Aeh.. Perhaps its faster to get all lines and use the filter()
 function

There is also <c-x><c-l> which completes lines. But this is not exactly
what you want to do...

The "mapping" is done by assigning omnifunc or completefunc omnifunc is
often used by $VIMRUNTIME/**/complet* scripts so completefunc is the
better choice.

Hello Marc, and thank you for replying.

However, this information, however right it might be, will do me not
much good. I consider vimscript a much harder language than anything
I've encountered before (aside from brainfuck and maybe whitespace).

I do get the expand-part. In any codepiece, expand('<cword>') expands
to the word at the cursor position.

I do get the difference between the two approaches. The first one
(previous) used an included function [I. Your new approach uses a
script, possible a function and utilizes the new completion technique
via omnifunc.

However, how those parts fit together completely eludes me. I can try
to give as much information as possible and hope this makes it easy
for one of the pros to hack a line together:

The regex to search would be '\<'.expand('<cword>').'\>'
The list should appear at the cursor position

Well, I don't have anything more. Thanks.

Thomas

--
GPG-Key: tengelke.de/thomas_michael_engelke.asc

Reply via email to