summaryrefslogtreecommitdiffstats
path: root/lisp/init-mac.el
blob: ba9bb2e8e710c4b35a6ca5d3247fbef71a21b092 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
;; mac-specific settings
(when (eq system-type 'darwin)
  ;; set font
  (set-face-attribute 'default nil :family "Source Code Pro")
  (set-face-attribute 'default nil :height 140)

  ;; configure modifiers
  (setq mac-option-modifier 'super)
  (setq mac-command-modifier 'meta)
  (setq ns-function-modifier 'hyper)

  ;; Norwegian mac-keyboard
  (define-key key-translation-map (kbd "s-8") (kbd "["))
  (define-key key-translation-map (kbd "s-(") (kbd "{"))
  (define-key key-translation-map (kbd "s-9") (kbd "]"))
  (define-key key-translation-map (kbd "s-)") (kbd "}"))
  (define-key key-translation-map (kbd "s-7") (kbd "|"))
  (define-key key-translation-map (kbd "s-/") (kbd "\\"))
  (define-key key-translation-map (kbd "M-s-7") (kbd "M-|")))

  ;; don't open files from the workspace in a new frame
  (setq ns-pop-up-frames nil)

  ;; move deleted files to ~/.Trash
  (setq delete-by-moving-to-trash t
        trash-directory "~/.Trash/emacs")

  ;; use path from shell
  (require-package 'exec-path-from-shell)
  (exec-path-from-shell-initialize)

(provide 'init-mac)