OS X Terminal: Meta key + alt functionality at the same time

后端 未结 16 1413
不知归路
不知归路 2020-12-22 22:38

Is there a way to use an alt / option key as a meta key but still be able to use it to make some characters which need it?

For example, in my l

相关标签:
16条回答
  • 2020-12-22 23:03

    I bit the grass and started hitting the escape key instead. You get use to it...

    0 讨论(0)
  • 2020-12-22 23:05

    Aquamacs supports that, at least for my (french) keyboard. Once Aquamacs is installed (via drag'n'drop), you can go to Options -> Option, Command, Meta keys and choose an appropriate setting for your keyboard (in my case, ...Meta & French). I am not proficient with Emacs, but all the useful combinations I have tried seem to work ([, {, |, and so forth).

    Supported keyboards, according to the menu items as of version 2.1, are :

    • British
    • US
    • Swiss-french
    • Swiss-german
    • Finnish
    • Italian-Pro
    • Italian
    • Spanish
    • French
    • German

    I would guess the Aquamacs team would be grateful for any contribution, though, should your keyboard not appear in the list.

    0 讨论(0)
  • 2020-12-22 23:06

    I use a Swedish keyboard in Mac OS X and use the following setup for Emacs.app:

    First I have KeyRemap4MacBook installed and I have it setup to change the left Option key to Command.

    I then have the following in my .emacs:

    (setq mac-option-modifier 'none)
    (setq mac-command-modifier 'meta)
    

    This makes Emacs treat command as Meta and ignore Option. Since the left Alt/Option key is remapped to command, this makes it work lite meta while the right Alt/Option key still works for entering special characters like @ [] and {}.

    App specific Mac shortcuts like Cmd+C and Cmd+V no longer work, but global shortcuts like Cmd+space for Spotlight and Cmd+Tab for app switching do.

    Update: If you use iTerm2 as a Terminal, that has support for mapping only the left Alt/Option key to meta, which means you can still use the right AltGr/Option key for entering special characters. This also means you can use meta as normal inside Emacs running in the iTerm2 terminal.

    0 讨论(0)
  • 2020-12-22 23:06

    Check out cmd-key-happy. This little app has worked wonders for me. It allows you to use command as meta, with exceptions that you can configure.

    Author's info follows:

    This program allows you to swap the command and alt (or option) keys in any application, but in particular Terminal.app.

    http://github.com/aim-stuff/cmd-key-happy

    0 讨论(0)
  • 2020-12-22 23:07

    This is an old post but adding an alternatives for Robots to find. I borrowed a couple of files from Aquamacs(emulate-mac-keyboard-mode.el, aquamacs-tools.el) that fixes the problem (I have a Italian-Pro keyboard) :

    (defun aq-binding (any)
     nil)
    (load  "~/.emacs.d/emulate-mac-keyboard-mode.el") ;;  'noerror
    

    this provides:

    • few minor modes (emulate-mac-italian-keyboard-mode, emulate-mac-french-keyboard-mode, mulate-mac-swiss-german-keyboard-mode, etc)
    • a menu to play with all the options provided by Aquamacs

    Tested with Emacs-23.3-universal-10.6.6 and seems to work ok for me.

    Thanks Aquamacs for this, what about pushing this upstream if not already done.

    0 讨论(0)
  • 2020-12-22 23:08

    I have a Swedish keyboard on my Mac and I'm using Aquamacs. Adding the two lines (attribution goes to Joakim Hårsman)

    (setq mac-option-modifier 'none)
    (setq mac-command-modifier 'meta)
    

    in .emacs (and restarting Aquamacs) did the trick for me.

    0 讨论(0)
提交回复
热议问题