Command key as Meta key in OS X Terminal.app

前端 未结 3 406
失恋的感觉
失恋的感觉 2021-01-31 08:10

When i unckeck the \'Use option as meta key\' box in Settings, and then do Cmd+F (which i want to mean Meta+F for forward-wo

相关标签:
3条回答
  • 2021-01-31 08:13

    The option as meta key selection has no effect on the Command (Apple) key. If option as meta key is selected, then the Option key acts as a Meta key in bash and elsewhere; just press Option+F. If you de-select it, there is no Meta key. (In either case, some command line programs may recognize the traditional ESC+char sequence as Meta char.)

    If you are running OS X 10.6 (Snow Leopard), Apple supplies a built-in way to change the meaning of the keyboard modifier keys, including Command and Option. Go to System Preferences -> Keyboard and click on the Modifier Key... button. A panel will appear that allows you to, for instance, swap the meaning of the Option and Command keys. But, be warned that this is a global option and will apply everywhere on OS X and could lead to some major confusion. If you do that, you will be swimming upstream as noted here. You will likely be best served long-term by getting used to the OS X default of using the Option key as Meta and, if necessary, restoring application defaults (for Emacs, say) to follow that convention.

    FURTHER EDIT: This blog post and program (untested) might be helpful.

    0 讨论(0)
  • 2021-01-31 08:24

    Just install keyremap4macbook utility from http://pqrs.org/macosx/keyremap4macbook/ .

    In the option, you can tweak Terminal.app many ways, not to mention Option to Command_L mapping and vice versa. It has so many handy options that i would say this is a must app for mac user!

    0 讨论(0)
  • 2021-01-31 08:27

    EDIT: I just realised this answer hasn't answered how to customise key mapping for the meta key. I hope however this answer might help others to find the meta key on a Mac though (it took me ages to find the meta key on Mac and this forum just helped me - so posting what I've got here. No harm I guess).

    On my Macbook Pro (el capitan), the meta key is by default mapped to the ESC key.

    For example, say in emacs editor, to do a M-% (emacs find and replace), I would do ESC+%

    (I've tested this on iTerm2 and Terminal app.)

    The answer posted by @NedDeily helped.

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