Loading ...
Sorry, an error occurred while loading the content.

Re: Meta and Option keys simultaneously in MacVim

Expand Messages
  • björn
    ... Hi, I can see that this sort of behavior would be useful for non-english keyboard layouts. Perhaps an easier solution (implementation-wise) than modifying
    Message 1 of 11 , Nov 9, 2010
    • 0 Attachment
      On 7 November 2010 16:56, Kazé <fabi1.cazenave@...> wrote:
      > Hello,
      >
      > with MacVim, the "macmeta" currently allows to use both "Option" keys
      > either as "Meta" or "AltGr". Like a lot of European users, I'd prefer
      > the "macmeta" pref to set only one "Option" key as "Meta" (e.g. the
      > left one, as it works on Windows and GNU/Linux) and keep the other one
      > for special characters on non-English keyboard layouts.
      >
      > In case someone is interested if having both a Meta key *and* an
      > Option key when "macmeta" is set, here's a quick and dirty patch:
      >
      >  diff --git a/src/MacVim/MMTextViewHelper.m b/src/MacVim/
      > MMTextViewHelper.m
      >  index 4d10432..42f311b 100644
      >  --- a/src/MacVim/MMTextViewHelper.m
      >  +++ b/src/MacVim/MMTextViewHelper.m
      >  @@ -22,6 +22,9 @@
      >  #import "MMWindowController.h"
      >  #import "Miscellaneous.h"
      >
      >  +// asymetric meta keys
      >  +#define NSLeftAlternateKeyMask  (0x000020 | NSAlternateKeyMask)
      >  +#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask)
      >
      >  // The max/min drag timer interval in seconds
      >  static NSTimeInterval MMDragTimerMaxInterval = 0.3;
      >  @@ -165,7 +168,8 @@ KeyboardInputSourcesEqual(TISInputSourceRef
      > a,TISInputSourceRef b)
      >     // ASCII chars in the range after space (0x20) and before
      > backspace (0x7f).
      >     // Note that this implies that 'mmta' (if enabled) breaks input
      > methods
      >     // when the Alt key is held.
      >  -    if ((flags & NSAlternateKeyMask) && [mmta boolValue] && [unmod
      > length] == 1
      >  +    if (((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask)
      >  +            && [mmta boolValue] && [unmod length] == 1
      >             && [unmod characterAtIndex:0] > 0x20
      >             && [unmod characterAtIndex:0] < 0x7f) {
      >         ASLogDebug(@"MACMETA key, don't interpret it");
      >
      > This is just a trivial adaptation of this iTerm patch:
      > http://swissarmyhammer.wordpress.com/2010/06/07/osx-terminal-meta-key-national-characters/
      > I think a proper MacVim integration would require to modify the
      > 'macmeta' stuff, e.g. by using a string pref instead of a boolean one:
      >
      >  * set macmeta=l     => left Option key is Meta
      >  * set macmeta=r     => right Option key is Meta
      >  * set macmeta=rl    => both Option keys are Meta
      >  * set macmeta=      => no Meta key
      >
      > Thoughts?

      Hi,

      I can see that this sort of behavior would be useful for non-english
      keyboard layouts. Perhaps an easier solution (implementation-wise)
      than modifying the 'macmeta' option (and one that doesn't break
      backwards compatibility) would be to have a user default to set which
      key is used as meta when 'macmeta' is enabled. This way it would be
      an app-level setting so all windows would use the same setting -- I
      don't know if this is a disadvantage or not (perhaps it is a bit
      confusing?).

      Anyway, that was just a though...I don't know which solution is better
      (making 'macmeta' a string option, or adding a user default). Does
      anybody else have any comments about this?

      I'm not against merging such a patch...

      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
    • Fabien Cazenave
      ... I think it won t make a big difference to the user if we keep a boolean pref for macmeta and add a string pref (e.g. macmetakeys ) to define which
      Message 2 of 11 , Nov 10, 2010
      • 0 Attachment
        2010/11/9 björn <bjorn.winckler@...>:
        > On 7 November 2010 16:56, Kazé <fabi1.cazenave@...> wrote:
        >> Hello,
        >>
        >> with MacVim, the "macmeta" currently allows to use both "Option" keys
        >> either as "Meta" or "AltGr". Like a lot of European users, I'd prefer
        >> the "macmeta" pref to set only one "Option" key as "Meta" (e.g. the
        >> left one, as it works on Windows and GNU/Linux) and keep the other one
        >> for special characters on non-English keyboard layouts.
        >>
        >> In case someone is interested if having both a Meta key *and* an
        >> Option key when "macmeta" is set, here's a quick and dirty patch:
        >>
        >>  diff --git a/src/MacVim/MMTextViewHelper.m b/src/MacVim/
        >> MMTextViewHelper.m
        >>  index 4d10432..42f311b 100644
        >>  --- a/src/MacVim/MMTextViewHelper.m
        >>  +++ b/src/MacVim/MMTextViewHelper.m
        >>  @@ -22,6 +22,9 @@
        >>  #import "MMWindowController.h"
        >>  #import "Miscellaneous.h"
        >>
        >>  +// asymetric meta keys
        >>  +#define NSLeftAlternateKeyMask  (0x000020 | NSAlternateKeyMask)
        >>  +#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask)
        >>
        >>  // The max/min drag timer interval in seconds
        >>  static NSTimeInterval MMDragTimerMaxInterval = 0.3;
        >>  @@ -165,7 +168,8 @@ KeyboardInputSourcesEqual(TISInputSourceRef
        >> a,TISInputSourceRef b)
        >>     // ASCII chars in the range after space (0x20) and before
        >> backspace (0x7f).
        >>     // Note that this implies that 'mmta' (if enabled) breaks input
        >> methods
        >>     // when the Alt key is held.
        >>  -    if ((flags & NSAlternateKeyMask) && [mmta boolValue] && [unmod
        >> length] == 1
        >>  +    if (((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask)
        >>  +            && [mmta boolValue] && [unmod length] == 1
        >>             && [unmod characterAtIndex:0] > 0x20
        >>             && [unmod characterAtIndex:0] < 0x7f) {
        >>         ASLogDebug(@"MACMETA key, don't interpret it");
        >>
        >> This is just a trivial adaptation of this iTerm patch:
        >> http://swissarmyhammer.wordpress.com/2010/06/07/osx-terminal-meta-key-national-characters/
        >> I think a proper MacVim integration would require to modify the
        >> 'macmeta' stuff, e.g. by using a string pref instead of a boolean one:
        >>
        >>  * set macmeta=l     => left Option key is Meta
        >>  * set macmeta=r     => right Option key is Meta
        >>  * set macmeta=rl    => both Option keys are Meta
        >>  * set macmeta=      => no Meta key
        >>
        >> Thoughts?
        >
        > Hi,
        >
        > I can see that this sort of behavior would be useful for non-english
        > keyboard layouts.  Perhaps an easier solution (implementation-wise)
        > than modifying the 'macmeta' option (and one that doesn't break
        > backwards compatibility) would be to have a user default to set which
        > key is used as meta when 'macmeta' is enabled.  This way it would be
        > an app-level setting so all windows would use the same setting -- I
        > don't know if this is a disadvantage or not (perhaps it is a bit
        > confusing?).
        >
        > Anyway, that was just a though...I don't know which solution is better
        > (making 'macmeta' a string option, or adding a user default).  Does
        > anybody else have any comments about this?
        >
        > I'm not against merging such a patch...
        >
        > Björn

        I think it won't make a big difference to the user if we keep a
        boolean pref for "macmeta" and add a string pref (e.g. "macmetakeys")
        to define which Option keys should be handled as Meta. The only
        problem I can see is that it could be a little confusing if "macmeta"
        is set to "true" but "macmetakeys" is empty -- though that could be
        partly avoided if "macmetakeys" is set to "l" or "rl" by default.

        However, if we have two prefs for the Meta keys we might want to add a
        third one to define whether the Meta key sets the 8th bit (= current
        behavior, like on gVim and xterm) or if it sends Escape instead (=
        like on most modern terminal emulators like *rxvt by default):
          * set nomacmetaescape  => map <M-a> :exe "myFunc()"<CR>
          * set macmetaescape      => map <Esc>a :exe "myFunc()"<CR>
        With such a setting, Meta-* shortcuts wouldn't be easy to use in
        insert mode but it could be appreciated by users who want an 8-bit
        clean MacVim *and* an Option key *and* a Meta key (if I'm the only one
        in this category, please don't tell me :-/). That's what has been
        implemented in the final iTerm patch I mentioned in my first message.

        :kazé

        --
        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
      • björn
        ... This sounds bad. My suggestion was to have a user default, e.g. MMWhichMeta with values 0=both (default), 1=left, 2=right. This avoid cluttering the core
        Message 3 of 11 , Nov 10, 2010
        • 0 Attachment
          On 10 November 2010 17:15, Fabien Cazenave <fabi1.cazenave@...> wrote:
          > 2010/11/9 björn <bjorn.winckler@...>:
          >> On 7 November 2010 16:56, Kazé <fabi1.cazenave@...> wrote:
          >>> Hello,
          >>>
          >>> with MacVim, the "macmeta" currently allows to use both "Option" keys
          >>> either as "Meta" or "AltGr". Like a lot of European users, I'd prefer
          >>> the "macmeta" pref to set only one "Option" key as "Meta" (e.g. the
          >>> left one, as it works on Windows and GNU/Linux) and keep the other one
          >>> for special characters on non-English keyboard layouts.
          >>>
          >>> In case someone is interested if having both a Meta key *and* an
          >>> Option key when "macmeta" is set, here's a quick and dirty patch:
          >>>
          >>>  diff --git a/src/MacVim/MMTextViewHelper.m b/src/MacVim/
          >>> MMTextViewHelper.m
          >>>  index 4d10432..42f311b 100644
          >>>  --- a/src/MacVim/MMTextViewHelper.m
          >>>  +++ b/src/MacVim/MMTextViewHelper.m
          >>>  @@ -22,6 +22,9 @@
          >>>  #import "MMWindowController.h"
          >>>  #import "Miscellaneous.h"
          >>>
          >>>  +// asymetric meta keys
          >>>  +#define NSLeftAlternateKeyMask  (0x000020 | NSAlternateKeyMask)
          >>>  +#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask)
          >>>
          >>>  // The max/min drag timer interval in seconds
          >>>  static NSTimeInterval MMDragTimerMaxInterval = 0.3;
          >>>  @@ -165,7 +168,8 @@ KeyboardInputSourcesEqual(TISInputSourceRef
          >>> a,TISInputSourceRef b)
          >>>     // ASCII chars in the range after space (0x20) and before
          >>> backspace (0x7f).
          >>>     // Note that this implies that 'mmta' (if enabled) breaks input
          >>> methods
          >>>     // when the Alt key is held.
          >>>  -    if ((flags & NSAlternateKeyMask) && [mmta boolValue] && [unmod
          >>> length] == 1
          >>>  +    if (((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask)
          >>>  +            && [mmta boolValue] && [unmod length] == 1
          >>>             && [unmod characterAtIndex:0] > 0x20
          >>>             && [unmod characterAtIndex:0] < 0x7f) {
          >>>         ASLogDebug(@"MACMETA key, don't interpret it");
          >>>
          >>> This is just a trivial adaptation of this iTerm patch:
          >>> http://swissarmyhammer.wordpress.com/2010/06/07/osx-terminal-meta-key-national-characters/
          >>> I think a proper MacVim integration would require to modify the
          >>> 'macmeta' stuff, e.g. by using a string pref instead of a boolean one:
          >>>
          >>>  * set macmeta=l     => left Option key is Meta
          >>>  * set macmeta=r     => right Option key is Meta
          >>>  * set macmeta=rl    => both Option keys are Meta
          >>>  * set macmeta=      => no Meta key
          >>>
          >>> Thoughts?
          >>
          >> Hi,
          >>
          >> I can see that this sort of behavior would be useful for non-english
          >> keyboard layouts.  Perhaps an easier solution (implementation-wise)
          >> than modifying the 'macmeta' option (and one that doesn't break
          >> backwards compatibility) would be to have a user default to set which
          >> key is used as meta when 'macmeta' is enabled.  This way it would be
          >> an app-level setting so all windows would use the same setting -- I
          >> don't know if this is a disadvantage or not (perhaps it is a bit
          >> confusing?).
          >>
          >> Anyway, that was just a though...I don't know which solution is better
          >> (making 'macmeta' a string option, or adding a user default).  Does
          >> anybody else have any comments about this?
          >>
          >> I'm not against merging such a patch...
          >>
          >> Björn
          >
          > I think it won't make a big difference to the user if we keep a
          > boolean pref for "macmeta" and add a string pref (e.g. "macmetakeys")
          > to define which Option keys should be handled as Meta. The only
          > problem I can see is that it could be a little confusing if "macmeta"
          > is set to "true" but "macmetakeys" is empty -- though that could be
          > partly avoided if "macmetakeys" is set to "l" or "rl" by default.

          This sounds bad. My suggestion was to have a user default, e.g.
          MMWhichMeta with values 0=both (default), 1=left, 2=right. This avoid
          cluttering the core Vim source code (something I try hard to avoid)
          and the patch would not require much source code.

          Alternately turn 'macmeta' into a string option ("lr","l","r") but I
          was under the impression that you'd once and for all decide which
          option key works as meta and then set 'macmeta' on/off per buffer. If
          this is true then this alternative seems worse to me.

          > However, if we have two prefs for the Meta keys we might want to add a
          > third one to define whether the Meta key sets the 8th bit (= current
          > behavior, like on gVim and xterm) or if it sends Escape instead (=
          > like on most modern terminal emulators like *rxvt by default):
          >   * set nomacmetaescape  => map <M-a> :exe "myFunc()"<CR>
          >   * set macmetaescape      => map <Esc>a :exe "myFunc()"<CR>
          > With such a setting, Meta-* shortcuts wouldn't be easy to use in
          > insert mode but it could be appreciated by users who want an 8-bit
          > clean MacVim *and* an Option key *and* a Meta key (if I'm the only one
          > in this category, please don't tell me :-/). That's what has been
          > implemented in the final iTerm patch I mentioned in my first message.

          You are losing me now. All I see is "let's add LOTS more options!
          (tm)". The general philosophy here should be "avoid adding more
          (Vim-) options at all cost".

          I don't really understand the issue with setting the 8th bit or
          sending escape, but since Vim already sets the 8th bit it seems like a
          very bad idea to change this behavior for the Mac only. Remember that
          Vim is not a terminal emulator (as opposed to iTerm which you
          mentioned in passing).

          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
        • Fabien Cazenave
          ... I m not sure I m following you. To try to make it clear: the MMWhichMeta would be fine, a string option for macmeta would be fine too. I hadn t thought
          Message 4 of 11 , Nov 10, 2010
          • 0 Attachment
            2010/11/10 björn <bjorn.winckler@...>:
            > On 10 November 2010 17:15, Fabien Cazenave <fabi1.cazenave@...> wrote:
            >> 2010/11/9 björn <bjorn.winckler@...>:
            >>> On 7 November 2010 16:56, Kazé <fabi1.cazenave@...> wrote:
            >>>> Hello,
            >>>>
            >>>> with MacVim, the "macmeta" currently allows to use both "Option" keys
            >>>> either as "Meta" or "AltGr". Like a lot of European users, I'd prefer
            >>>> the "macmeta" pref to set only one "Option" key as "Meta" (e.g. the
            >>>> left one, as it works on Windows and GNU/Linux) and keep the other one
            >>>> for special characters on non-English keyboard layouts.
            >>>>
            >>>> In case someone is interested if having both a Meta key *and* an
            >>>> Option key when "macmeta" is set, here's a quick and dirty patch:
            >>>>
            >>>>  diff --git a/src/MacVim/MMTextViewHelper.m b/src/MacVim/
            >>>> MMTextViewHelper.m
            >>>>  index 4d10432..42f311b 100644
            >>>>  --- a/src/MacVim/MMTextViewHelper.m
            >>>>  +++ b/src/MacVim/MMTextViewHelper.m
            >>>>  @@ -22,6 +22,9 @@
            >>>>  #import "MMWindowController.h"
            >>>>  #import "Miscellaneous.h"
            >>>>
            >>>>  +// asymetric meta keys
            >>>>  +#define NSLeftAlternateKeyMask  (0x000020 | NSAlternateKeyMask)
            >>>>  +#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask)
            >>>>
            >>>>  // The max/min drag timer interval in seconds
            >>>>  static NSTimeInterval MMDragTimerMaxInterval = 0.3;
            >>>>  @@ -165,7 +168,8 @@ KeyboardInputSourcesEqual(TISInputSourceRef
            >>>> a,TISInputSourceRef b)
            >>>>     // ASCII chars in the range after space (0x20) and before
            >>>> backspace (0x7f).
            >>>>     // Note that this implies that 'mmta' (if enabled) breaks input
            >>>> methods
            >>>>     // when the Alt key is held.
            >>>>  -    if ((flags & NSAlternateKeyMask) && [mmta boolValue] && [unmod
            >>>> length] == 1
            >>>>  +    if (((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask)
            >>>>  +            && [mmta boolValue] && [unmod length] == 1
            >>>>             && [unmod characterAtIndex:0] > 0x20
            >>>>             && [unmod characterAtIndex:0] < 0x7f) {
            >>>>         ASLogDebug(@"MACMETA key, don't interpret it");
            >>>>
            >>>> This is just a trivial adaptation of this iTerm patch:
            >>>> http://swissarmyhammer.wordpress.com/2010/06/07/osx-terminal-meta-key-national-characters/
            >>>> I think a proper MacVim integration would require to modify the
            >>>> 'macmeta' stuff, e.g. by using a string pref instead of a boolean one:
            >>>>
            >>>>  * set macmeta=l     => left Option key is Meta
            >>>>  * set macmeta=r     => right Option key is Meta
            >>>>  * set macmeta=rl    => both Option keys are Meta
            >>>>  * set macmeta=      => no Meta key
            >>>>
            >>>> Thoughts?
            >>>
            >>> Hi,
            >>>
            >>> I can see that this sort of behavior would be useful for non-english
            >>> keyboard layouts.  Perhaps an easier solution (implementation-wise)
            >>> than modifying the 'macmeta' option (and one that doesn't break
            >>> backwards compatibility) would be to have a user default to set which
            >>> key is used as meta when 'macmeta' is enabled.  This way it would be
            >>> an app-level setting so all windows would use the same setting -- I
            >>> don't know if this is a disadvantage or not (perhaps it is a bit
            >>> confusing?).
            >>>
            >>> Anyway, that was just a though...I don't know which solution is better
            >>> (making 'macmeta' a string option, or adding a user default).  Does
            >>> anybody else have any comments about this?
            >>>
            >>> I'm not against merging such a patch...
            >>>
            >>> Björn
            >>
            >> I think it won't make a big difference to the user if we keep a
            >> boolean pref for "macmeta" and add a string pref (e.g. "macmetakeys")
            >> to define which Option keys should be handled as Meta. The only
            >> problem I can see is that it could be a little confusing if "macmeta"
            >> is set to "true" but "macmetakeys" is empty -- though that could be
            >> partly avoided if "macmetakeys" is set to "l" or "rl" by default.
            >
            > This sounds bad.  My suggestion was to have a user default, e.g.
            > MMWhichMeta with values 0=both (default), 1=left, 2=right.  This avoid
            > cluttering the core Vim source code (something I try hard to avoid)
            > and the patch would not require much source code.
            >
            > Alternately turn 'macmeta' into a string option ("lr","l","r") but I
            > was under the impression that you'd once and for all decide which
            > option key works as meta and then set 'macmeta' on/off per buffer.  If
            > this is true then this alternative seems worse to me.
            >

            I'm not sure I'm following you. To try to make it clear: the
            MMWhichMeta would be fine, a string option for "macmeta" would be fine
            too.

            I hadn't thought of the global/buffer scope because I'm used to set
            the Meta behavior once for all (i.e. in my ~/.Xmodmap and
            ~/.Xresources files) when I use Vim in a terminal. I don't think we
            need any per-buffer setting for these Meta keys.


            >> However, if we have two prefs for the Meta keys we might want to add a
            >> third one to define whether the Meta key sets the 8th bit (= current
            >> behavior, like on gVim and xterm) or if it sends Escape instead (=
            >> like on most modern terminal emulators like *rxvt by default):
            >>   * set nomacmetaescape  => map <M-a> :exe "myFunc()"<CR>
            >>   * set macmetaescape      => map <Esc>a :exe "myFunc()"<CR>
            >> With such a setting, Meta-* shortcuts wouldn't be easy to use in
            >> insert mode but it could be appreciated by users who want an 8-bit
            >> clean MacVim *and* an Option key *and* a Meta key (if I'm the only one
            >> in this category, please don't tell me :-/). That's what has been
            >> implemented in the final iTerm patch I mentioned in my first message.
            >
            > You are losing me now.  All I see is "let's add LOTS more options!
            > (tm)".  The general philosophy here should be "avoid adding more
            > (Vim-) options at all cost".
            >
            > I don't really understand the issue with setting the 8th bit or
            > sending escape, but since Vim already sets the 8th bit it seems like a
            > very bad idea to change this behavior for the Mac only.  Remember that
            > Vim is not a terminal emulator (as opposed to iTerm which you
            > mentioned in passing).
            >

            To make it shorter: if we can have a Meta key *and* an Option key on
            MacVim, it'll be awesome -- even if Meta sets the 8th bit.

            Vim itself leaves the question of the 8th bit to the terminal emulator
            -- and nowadays, most terminal emulators rather send Escape to avoid
            conflicts with non-ASCII charsets (which is a good thing). But you're
            right, gVim *does* set the 8th bit (which is bad) and it wouldn't make
            much sense to add a "MetaSendsEscape" pref for the Mac only: I'll go
            bother the gVim team about that. ^^

            Thanks again for your efforts!
            :kazé

            --
            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
          • Martin Lundberg
            Was this every implemented? I can t see anything about it in the help files. I would really want to have a way to use both of them as well. Using vim in
            Message 5 of 11 , Nov 23, 2011
            • 0 Attachment
              Was this every implemented? I can't see anything about it in the help files. I would really want to have a way to use both of them as well. Using vim in terminal I can do this through iTerm2 but in MacVim I'm not sure how to do it.

              --
              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
            • björn
              ... I never received a patch, so no, it has not been implemented (I will not implement this myself since I have no use for it and my impression was that not
              Message 6 of 11 , Nov 23, 2011
              • 0 Attachment
                On 23 November 2011 09:28, Martin Lundberg wrote:
                > Was this every implemented? I can't see anything about it in the help files.
                > I would really want to have a way to use both of them as well. Using vim in
                > terminal I can do this through iTerm2 but in MacVim I'm not sure how to do
                > it.

                I never received a patch, so no, it has not been implemented (I will
                not implement this myself since I have no use for it and my impression
                was that not too many people were asking for it).

                Still waiting ...

                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
              • Fabien Cazenave
                Martin: the simple patch I included in my first message might work, though it won t be configurable -- the right Option key will always be a Meta key. I
                Message 7 of 11 , Nov 23, 2011
                • 0 Attachment
                  Martin: the simple patch I included in my first message might work,
                  though it won't be configurable -- the right "Option" key will always be
                  a "Meta" key.

                  I don't have any Mac any more so I don't use MacVim atm, but I can try
                  to rebase this mini-patch on the current code tree if you wish.

                  Le 23/11/2011 20:07, björn a écrit :
                  > On 23 November 2011 09:28, Martin Lundberg wrote:
                  >> Was this every implemented? I can't see anything about it in the help files.
                  >> I would really want to have a way to use both of them as well. Using vim in
                  >> terminal I can do this through iTerm2 but in MacVim I'm not sure how to do
                  >> it.
                  >
                  > I never received a patch, so no, it has not been implemented (I will
                  > not implement this myself since I have no use for it and my impression
                  > was that not too many people were asking for it).

                  Well, I haven't sent any patch because you didn't tell me what kind of
                  pref you'd like to have for this meta/option key stuff -- or if you did,
                  I didn't get it. :-/

                  All I know is that a single, boolean, "macmeta" option won't be enough.
                  I think we have to implement another option to define which key(s)
                  should work as "Meta" instead of "Option" but I understood that you
                  didn't want to have that kind of stuff in the code.

                  Björn: if you tell me what option(s) you want for this, and if you can
                  give me a couple pointers to get me started with the pref system in
                  MacVim, I can try to borrow a Mac and work on this patch. If you think
                  it's not worth the trouble, well... better tell me.

                  BTW: MacVim is the only thing I really miss from the 12 months I've
                  worked under OSX. Keep up the good work!

                  --
                  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
                • Martin Lundberg
                  I m just throwing this out without actually knowing much about it but what about making it so holding two buttons like ctrl and alt would work as meta? Is it
                  Message 8 of 11 , Nov 24, 2011
                  • 0 Attachment
                    I'm just throwing this out without actually knowing much about it but
                    what about making it so holding two buttons like ctrl and alt would
                    work as meta? Is it possible? Wouldn't have to be ctrl and alt but any
                    combination of ctrl, shift, alt and command? :)

                    --
                    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
                  • björn
                    ... My suggestion was to have a user default, e.g. MMWhichMeta with values 0=both (default), 1=left, 2=right. This avoid cluttering the core Vim source code
                    Message 9 of 11 , Nov 25, 2011
                    • 0 Attachment
                      On 24 November 2011 01:12, Fabien Cazenave wrote:
                      >> On 23 November 2011 09:28, Martin Lundberg wrote:
                      >>>
                      >>> Was this every implemented? I can't see anything about it in the help
                      >>> files.
                      >>> I would really want to have a way to use both of them as well. Using vim
                      >>> in
                      >>> terminal I can do this through iTerm2 but in MacVim I'm not sure how to
                      >>> do
                      >>> it.
                      >>
                      >> I never received a patch, so no, it has not been implemented (I will
                      >> not implement this myself since I have no use for it and my impression
                      >> was that not too many people were asking for it).
                      >
                      > Well, I haven't sent any patch because you didn't tell me what kind of pref
                      > you'd like to have for this meta/option key stuff -- or if you did, I didn't
                      > get it. :-/
                      >
                      > All I know is that a single, boolean, "macmeta" option won't be enough. I
                      > think we have to implement another option to define which key(s) should work
                      > as "Meta" instead of "Option" but I understood that you didn't want to have
                      > that kind of stuff in the code.
                      >
                      > Björn: if you tell me what option(s) you want for this, and if you can give
                      > me a couple pointers to get me started with the pref system in MacVim, I can
                      > try to borrow a Mac and work on this patch. If you think it's not worth the
                      > trouble, well... better tell me.

                      I did outline two methods which would be acceptable:

                      --- 8< ---
                      My suggestion was to have a user default, e.g.
                      MMWhichMeta with values 0=both (default), 1=left, 2=right. This avoid
                      cluttering the core Vim source code (something I try hard to avoid)
                      and the patch would not require much source code.

                      Alternately turn 'macmeta' into a string option ("lr","l","r") but I
                      was under the impression that you'd once and for all decide which
                      option key works as meta and then set 'macmeta' on/off per buffer. If
                      this is true then this alternative seems worse to me.
                      --- >8 ....

                      I think the fist alternative is preferable. The second would break
                      backwards compatibility. Sorry that I'm just quoting myself here, but
                      I don't think I can make it any clearer.

                      How to add new user defaults should not be hard to figure out.
                      However, if you are no longer using OS X it would probably be better
                      to let somebody else who is interested to implement this (hint
                      Martin). It is preferable if people who send patches also are willing
                      (and able) to maintain them.

                      > BTW: MacVim is the only thing I really miss from the 12 months I've worked
                      > under OSX. Keep up the good work!

                      Thanks!

                      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
                    • Martin Lundberg
                      ... I would if I could but I m not good enough in C/Object-C. I tried fixing this problem using other apps like KeyRemap4Macbook but now I got my computer in a
                      Message 10 of 11 , Nov 29, 2011
                      • 0 Attachment
                        On Fri, Nov 25, 2011 at 3:47 PM, björn <bjorn.winckler@...> wrote:
                        > How to add new user defaults should not be hard to figure out.
                        > However, if you are no longer using OS X it would probably be better
                        > to let somebody else who is interested to implement this (hint
                        > Martin).  It is preferable if people who send patches also are willing
                        > (and able) to maintain them.

                        I would if I could but I'm not good enough in C/Object-C. I tried
                        fixing this problem using other apps like KeyRemap4Macbook but now I
                        got my computer in a weird state where I could not enter swedish
                        letter å because a plugin had a mapping to it which it did not have
                        before. Just wanted to say that to warn others from playing too much
                        with such apps. Temporarily solved it by remapping in vim.

                        -Martin

                        --
                        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
                      Your message has been successfully submitted and would be delivered to recipients shortly.