Help us understand the problem. What is going on with this article?

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

More than 3 years have passed since last update.

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
  ;; 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
  ;; 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