added a very helpful command prelude-swap-meta-and-super bound to C-c w

This commit is contained in:
Bozhidar Batsov 2012-10-05 10:31:31 +03:00
parent 3e45726967
commit e1fcc4454e

View file

@ -11,4 +11,21 @@
;; but they do need Meta and Super ;; but they do need Meta and Super
(setq mac-command-modifier 'super) (setq mac-command-modifier 'super)
(setq mac-option-modifier 'meta) (setq mac-option-modifier 'meta)
(defun prelude-swap-meta-and-super ()
"Swap the mapping of meta and super. Very useful for people using their Mac
with a Windows external keyboard from time to time."
(interactive)
(if (eq mac-command-modifier 'super)
(progn
(setq mac-command-modifier 'meta)
(setq mac-option-modifier 'super)
(message "Command is now bound to META and Option is bound to SUPER."))
(progn
(setq mac-command-modifier 'super)
(setq mac-option-modifier 'meta)
(message "Command is now bound to SUPER and Option is bound to META."))))
(define-key prelude-mode-map (kbd "C-c w") 'prelude-swap-meta-and-super)
(provide 'prelude-osx) (provide 'prelude-osx)