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

后端 未结 16 1509
不知归路
不知归路 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: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.

提交回复
热议问题