On 22 October 2010 13:42, Barrie Stott <[email protected]> wrote: > I have used vim for some time but am new to both macs and MacVim. My main > problem is with modifier keys on my Apple wireless keyboard. They cluster > around the bottom left of the keyboard and can be named as CapsLock, Shift, > Fn, Ctrl, Alt, and Cmd. > > First, there is their naming: how do I reference them?. I can deal with > Shift, Ctrl and Cmd, with key a, as <S-a>, <C-a> and <D-a> but am struggling > with the others. Help would be much appreciated. > > Next, there is their use. Below is a sequence of lines that I'm using for > experiments. They occur at the end of the mappings I've used on linux for > some considerable time. > > I am expecting that the first 7 lines isolate me from all my former mappings. > Please tell me if they don't and what their replacements should be.
I've never needed to use any of these, but a quick glance at the help seems to indicate that they do clear a mapping. However, this may not clear all mappings (e.g. it won't work with some <D-..> mappings because they are bounds to Mac menus using :macmenu). > The next 5 pairs of lines constitute my current experiment. Unfortunately, > only the first 2 pairs do anything sensible. I type <S-a> repeatedly in > normal mode and the string 'shift ok ' appears repeatedly (without quotes). A > similar thing occurs in insert mode except 'ishift ok ' appears as expected. > The results from <C-z> are analogous in all respects. Looking carefully at > the stuff you will see that each map has 2 spaces after ok but the result has > a single space. How can I make the result of using the map agree with the > string in the map? Maybe it'll work if you backslash escape spaces? > None of the other maps does anything sensible. In normal mode, they all give > a 'boing' sound; in insert mode, they all give more or less the character > typed, as though there were no map; <M-v> gives √, <A-x> gives ≈, and <D-§> > gives <D-§>. > > :mapc > :mapc! > :imapc > :vmapc > :omapc > :nmapc > :cmapc > :nmap <S-a> ishift ok <Esc> > :imap <S-a> ishift ok > :nmap <C-z> ictrl ok <Esc> > :imap <C-z> ictrl ok > :nmap <M-v> iM ok <Esc> > :imap <M-v> iM ok > :nmap <A-x> iA ok <Esc> > :imap <A-x> iA ok > :nmap <D-§> iD ok <Esc> > :imap <D-§> iD ok > > I would be very grateful for any light that anyone can shed on these > problems, be it specific solutions, reference to mac documentation or > something else. Unless you enable 'macmeta' you'll run into trouble binding to <M-..> (which is synonymous with <A-..>). See ":h 'macmeta". As for <D-..> bindings -- if you bind to exactly what is printed in insert mode (i.e. the <D-..> sequence) it should work. Can you tell me what keyboard layout you are using and exactly which keys are problematic? Björn -- You received this message from the "vim_mac" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
