On 03/05/09 05:43, Mahurshi Akilla wrote:
[top-posting corrected]
> On May 2, 6:20 pm, Tony Mechelynck<[email protected]>
> wrote:
>> On 03/05/09 01:17, Mahurshi Akilla wrote:
>>
>>
>>
>>> The below map works fine in vim, but requires a carriage return in
>>> gvim to call the function.  Is there a way to get gvim to not require
>>> the additional carriage return after I press `
>>
>>> map<silent>    ` :call myfunc()<CR>
>>
>>> Mahurshi Akilla
>>
>> It may depend on your keyboard. On mine, there is no backtick but there
>> is a grave-accent deadkey and I need to add a space to get the backtick.
>>
>> Does it work if you replace the backtick by<F12>  in the mapping then
>> hit the F12 key to trigger it?
>>
>> Best regards,
>> Tony.
>
> You're right.  The function keys do not seem to require the carriage
> return in gvim.  Is there a setting I can tinker with to make gvim
> behave like vim in this case?  I like my one keystroke mappings in vim
> and would love to have them work the same way in gvim. :-)
>
> Mahurshi Akilla
>

On rereading this thread, I see two possibilities:

(a) if you have other mappings in gvim whose {lhs} starts with a 
backtick, then as long as those mappings exist, Vim has to wait for 
'timeout' milliseconds or until you have typed enough additional 
characters after the bactick to resolve the ambiguity, whichever comes 
first. Use

        :verbose map `
        :verbose map! `

(the former for Normal, Visual and Operator-pending, the latter for 
Insert/Replace and Command-line) to display any such mappings and the 
place where they were set. If there are any, you may have to decide 
which ones, if any you want to keep. You may need to prefix the backtick 
with hitting Ctrl-V to avoid triggering the mapping.

(b) If you're on Unix/Linux and your backtick key is actually a dead key 
under X11 but not in the pure-text console (they use different keyboard 
drivers), then it should work the same as in gvim in every X application 
including xterm (and Console Vim running in xterm) but not necessarily 
in the text-only console (on Linux, open it by Ctrl-Alt-F1 to 
Ctrl-Alt-F6 and go back to X with Ctrl-Alt-F7). In that case, to change 
that behaviour (for all X applications at once) you'll need to change it 
in X11; I'm not sure how but I think xmodmap is a possibility (see "man 
xmodmap").


Best regards,
Tony.
-- 
You may be sure that when a man begins to call himself a "realist," he
is preparing to do something he is secretly ashamed of doing.
                -- Sydney Harris

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

Reply via email to