On 11/11/08 09:43, Tom Link wrote:
> Hi,
>
> I'd like to show the menu bar only when the alt key is pressed.
> Alternatively: I'd like to press the alt key alone to toggle the
> display of the menu bar.
>
> Creating a function to toggle the display of the menu bar is trivial.
> But how could I map the alt key? Is there a way to do this or do I
> have to map this function to some regular key? I use gvim for windows.
>
> Regards,
> Thomas.

You can't, or at least not by Vim means. Some OSes allows remapping of 
keyboard keys (e.g. to switch Ctrl with CapsLock, or CapsLock with Esc) 
but that would mean mapping the Alt key to something that Vim can detect 
(F10 maybe, or F13 if that means anything), but I suppose it would 
disable all Alt-something keychords.

You can trigger the Vim menu by means of the ":emenu" command, even in 
Console Vim provided that you've sourced $VIMRUNTIME/menu.vim

Here's the relevant part of in my vimrc:

if 1
        runtime! menu.vim
endif
runtime vimrc_example.vim
if has("wildmenu")
        set wildmenu wildmode=longest:full,full
else
        set wildmode=longest,list:longest,full
endif
set wildcharm=<C-T>     " or any key not needed in Command-line mode
if has('menu')
        " override Ctrl-Z (minimize) by a text-mode menu
        map     <C-Z>   :emenu <C-T>
        imap    <C-Z>   <C-O>:emenu <C-T>
endif



Best regards,
Tony.
-- 
Space is big.  You just won't believe how vastly, hugely, mind-
bogglingly big it is.  I mean, you may think it's a long way down the
road to the drug store, but that's just peanuts to space.
                -- "The Hitchhiker's Guide to the Galaxy"

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

Reply via email to