Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
OrganizationEventAdvent CalendarQiitadon (β)
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

init.el: MacのキーボードでMetaAltSuperHyper

Macでemacsを使っているかた、右のCommand keyやOption keyを使っていますか?


  • 左Option: Alt 設定する時は (kbd "A-a")
  • 左Command: Meta 設定する時は (kbd "M-a")
  • 右Command: Super 設定する時は (kbd "s-a")
  • 右Option: Hyper 設定する時は (kbd "H-a")



;;; Mac-only configuration to use command and options keys
(when (eq system-type 'darwin)
  ;; Mac-only
  ;; Command key as Meta key, Option key untouched
  ;; http://www.emacswiki.org/emacs/MetaKeyProblems#toc15
  ;; http://ergoemacs.org/emacs/emacs_hyper_super_keys.html
  ;; left command
  (setq mac-command-modifier 'meta)
  ;; left option
  (setq mac-option-modifier 'alt)
  ;; right command
  (setq mac-right-command-modifier 'super)
  ;; right option
  (setq mac-right-option-modifier 'hyper)
  ;; Mac Binding modifier keys
  ;; http://www.emacswiki.org/emacs/EmacsForMacOS#toc23
  ;; mac-function-modifier
  ;; mac-control-modifier
  ;; mac-command-modifier
  ;; mac-option-modifier
  ;; mac-right-command-modifier
  ;; mac-right-control-modifier
  ;; mac-right-option-modifier
  ;; values can be 'control (C), 'alt (A), 'meta (M), 'super (s), or 'hyper (H).
  ;; setting to nil allows the OS to assign values


(global-set-key (kbd "s-g")   'magit-status)


Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Help us understand the problem. What are the problem?