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.

65 lines
2.1 KiB

13 years ago
  1. ;;; prelude-osx.el --- Emacs Prelude: OSX specific settings.
  2. ;;
  3. ;; Copyright © 2011-2013 Bozhidar Batsov
  4. ;;
  5. ;; Author: Bozhidar Batsov <bozhidar@batsov.com>
  6. ;; URL: https://github.com/bbatsov/prelude
  7. ;; Version: 1.0.0
  8. ;; Keywords: convenience
  9. ;; This file is not part of GNU Emacs.
  10. ;;; Commentary:
  11. ;; Some OSX specific stuff.
  12. ;;; License:
  13. ;; This program is free software; you can redistribute it and/or
  14. ;; modify it under the terms of the GNU General Public License
  15. ;; as published by the Free Software Foundation; either version 3
  16. ;; of the License, or (at your option) any later version.
  17. ;;
  18. ;; This program is distributed in the hope that it will be useful,
  19. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. ;; GNU General Public License for more details.
  22. ;;
  23. ;; You should have received a copy of the GNU General Public License
  24. ;; along with GNU Emacs; see the file COPYING. If not, write to the
  25. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  26. ;; Boston, MA 02110-1301, USA.
  27. ;;; Code:
  28. ;; On OS X Emacs doesn't use the shell PATH if it's not started from
  29. ;; the shell. Let's fix that:
  30. (prelude-ensure-module-deps '(exec-path-from-shell))
  31. (require 'exec-path-from-shell)
  32. (exec-path-from-shell-initialize)
  33. ;; It's all in the Meta
  34. (setq ns-function-modifier 'hyper)
  35. (defun prelude-swap-meta-and-super ()
  36. "Swap the mapping of Meta and Super.
  37. Very useful for people using their Mac with a
  38. Windows external keyboard from time to time."
  39. (interactive)
  40. (if (eq mac-command-modifier 'super)
  41. (progn
  42. (setq mac-command-modifier 'meta)
  43. (setq mac-option-modifier 'super)
  44. (message "Command is now bound to META and Option is bound to SUPER."))
  45. (progn
  46. (setq mac-command-modifier 'super)
  47. (setq mac-option-modifier 'meta)
  48. (message "Command is now bound to SUPER and Option is bound to META."))))
  49. (define-key prelude-mode-map (kbd "C-c w") 'prelude-swap-meta-and-super)
  50. (define-key prelude-mode-map (kbd "s-/") 'hippie-expand)
  51. (menu-bar-mode +1)
  52. (provide 'prelude-osx)
  53. ;;; prelude-osx.el ends here