doomemacs/init/core-osx.el

39 lines
1.4 KiB
EmacsLisp
Raw Normal View History

2014-12-05 17:28:03 -05:00
;; Mac-specific settings
2014-12-05 17:28:03 -05:00
;; Use a shared clipboard
(setq x-select-enable-clipboard t)
;; Curse Lion and its sudden but inevitable fullscreen mode!
(setq ns-use-native-fullscreen nil)
;; Don't open files from the workspace in a new frame
(setq ns-pop-up-frames nil)
2014-08-07 18:35:22 -04:00
2015-05-03 01:47:50 -04:00
;; Prefixes: Command = M, Alt = A
(setq mac-command-modifier 'meta)
(setq mac-option-modifier 'alt)
2014-12-05 17:28:03 -05:00
;; fix emacs PATH on OSX (GUI only)
2015-05-28 22:24:43 -04:00
(use-package exec-path-from-shell
:config (exec-path-from-shell-initialize))
(use-package applescript-mode :mode "\\.applescript$")
2014-12-05 17:28:03 -05:00
(after "evil"
;; On OSX, stop copying each visual state move to the clipboard:
;; https://bitbucket.org/lyro/evil/issue/336/osx-visual-state-copies-the-region-on
;; Most of this code grokked from:
;; http://stackoverflow.com/questions/15873346/elisp-rename-macro
(defadvice evil-visual-update-x-selection (around clobber-x-select-text activate)
(unless (featurep 'ns) ad-do-it)))
2014-12-05 17:28:03 -05:00
;; Send current file to OSX apps
2015-05-08 03:03:38 -04:00
(defun my-open-with (&optional app-name path)
(interactive)
2015-05-28 22:24:43 -04:00
(let* ((path (f-full (s-replace "'" "\\'" (or path (if (eq major-mode 'dired-mode) (dired-get-file-for-visit) (buffer-file-name))))))
(command (concat "open " (when app-name (concat "-a " (shell-quote-argument app-name))) " '" path "'")))
(message "Trying: %s" command)
(shell-command command)))
2014-12-10 15:54:36 -05:00
2015-01-09 21:47:51 -05:00
(provide 'core-osx)
2015-05-08 03:03:38 -04:00
;;; core-osx.el ends here