Sorry, when I said I'd put in a "plug" it was kinda pun (i.e.
plug==advertisement) :-)
It is actually a source patch (not a Vim script plugin), which is the
only real way to intercept character events.
You can get it on sourceforge,
http://www.vim.org/scripts/script.php?script_id=1541
but you'll have to be able to compile your own copy of Vim.
If you do decide to try it out, please send or post your comments, so that
1) I can improve on it,
2) third party feedback is one element for such source patches ever
becoming part of the released Vim version.
P.S. Instead of unsubscribing, you might see if your mail system has
the option of filtering all the [email protected] mail into a subfolder.
On 6/26/06, Jason Frerich <[EMAIL PROTECTED]> wrote:
Eric and Hari,
Thanks for the help. I was taking this on as a side project and this is
my first experience programming vim. Hari, I haven't had time to
implement your method and Eric, I'll be awaiting your plug. Could
either of you email me directly with any updates? I just subscribed to
vim.org and I am getting way too much mail for my taste! I am going to
unsubscribe until I have further questions.
Thank you very much,
Jason
Eric Arnold wrote:
> I'll put in a plug for my GetChar event patch, which would allow this :-)
>
>
>
> On 6/22/06, Hari Krishna Dara <[EMAIL PROTECTED]> wrote:
>
>>
>> On Thu, 22 Jun 2006 at 5:36pm, Jason Frerich wrote:
>>
>> > How can I tell the search '/' command to perform a task after typing
>> > each letter on the pattern line.
>> >
>> > For Example:
>> > /g0ee
>> > I would like the above to execute as the following:
>> > /g - sendcommand(g)
>> > 0 - sendcommand(g0)
>> > e - sendcommand(g0e)
>> > e - sendcommand(g0ee)
>> >
>> > After each letter is typed, I would like to send that letter(s) to a
>> > function call "sendcommand".
>> >
>> > Jason
>>
>> I can't think of a simple way to capture all keys without mapping all
>> possible keys, something like:
>>
>> for ch in range(32, 126)
>> exec 'nnoremap <expr>' nr2char(ch) 'sendcommand('.nr2char(ch).')'
>> endfor
>>
>> Inside sendcommand() you should check the mode, something like:
>>
>> function sendcommand(ch)
>> if getcmdtype() == '/'
>> " do something
>> endif
>> return a:ch
>> endfunction
>>
>> If this is not acceptable to you, you can map / to trigger your function
>> which will read the keys using getchar(). You will have to implement at
>> least a sub set of editing mode keys. Take a look at my execmap.vim
>> plugin that does this.
>>
>> --
>> HTH,
>> Hari
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam? Yahoo! Mail has the best spam protection around
>> http://mail.yahoo.com
>>
>