Emacs config utilizing prelude as a base
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.2 KiB

  1. ;; On OS X Emacs doesn't use the shell PATH if it's not started from
  2. ;; the shell.
  3. ;; If you're using homebrew or port, modifying the PATH is essential.
  4. (let (osx-paths)
  5. (dolist (path '("/usr/local/bin" "/opt/local/bin" "/opt/local/sbin" "$HOME/bin")
  6. (setenv "PATH" (concat osx-paths (getenv "PATH"))))
  7. (push path exec-path)
  8. (setq osx-paths (concat (concat path ":") osx-paths))))
  9. ;; Emacs users obviously have little need for Command and Option keys,
  10. ;; but they do need Meta and Super
  11. (setq mac-command-modifier 'super)
  12. (setq mac-option-modifier 'meta)
  13. (defun prelude-swap-meta-and-super ()
  14. "Swap the mapping of meta and super. Very useful for people using their Mac
  15. with a Windows external keyboard from time to time."
  16. (interactive)
  17. (if (eq mac-command-modifier 'super)
  18. (progn
  19. (setq mac-command-modifier 'meta)
  20. (setq mac-option-modifier 'super)
  21. (message "Command is now bound to META and Option is bound to SUPER."))
  22. (progn
  23. (setq mac-command-modifier 'super)
  24. (setq mac-option-modifier 'meta)
  25. (message "Command is now bound to SUPER and Option is bound to META."))))
  26. (define-key prelude-mode-map (kbd "C-c w") 'prelude-swap-meta-and-super)
  27. (provide 'prelude-osx)