2015-04-19 03:40:24 +00:00
|
|
|
(setq osx-packages
|
2015-02-07 04:35:46 +00:00
|
|
|
'(
|
|
|
|
pbcopy
|
2015-07-06 12:17:24 +00:00
|
|
|
launchctl
|
2015-08-04 06:58:05 +00:00
|
|
|
reveal-in-osx-finder
|
2015-04-19 03:40:24 +00:00
|
|
|
))
|
2015-02-07 04:35:46 +00:00
|
|
|
|
2015-08-23 01:47:30 +00:00
|
|
|
(when (spacemacs/system-is-mac)
|
2015-07-06 13:43:20 +00:00
|
|
|
;; Note: `delete-by-moving-to-trash' is set to true globaly in
|
|
|
|
;; `spacemacs/config.el'
|
|
|
|
;; (setq trash-directory "~/.Trash/emacs") ; bare minimum
|
|
|
|
|
|
|
|
;; Use `trash' cli tool, if installed.
|
|
|
|
;; See brew info trash (or osx-tools)
|
|
|
|
;; otherwise, enable built-in support for trashing using Finder API
|
|
|
|
|
|
|
|
(if (executable-find "trash")
|
|
|
|
(defun system-move-file-to-trash (file)
|
|
|
|
"Use `trash' to move FILE to the system/volume trash can.
|
2015-08-23 01:47:30 +00:00
|
|
|
Can be installed with `brew install trash'."
|
2015-07-06 13:43:20 +00:00
|
|
|
(call-process (executable-find "trash") nil 0 nil file))
|
|
|
|
(setq mac-system-move-file-to-trash-use-finder t))
|
|
|
|
|
|
|
|
;; Use `gls' if `coreutils' was installed prefixed ('g') otherwise, leave
|
|
|
|
;; alone. Manually add to config `(setq dired-use-ls-dired nil)' to surpesss
|
|
|
|
;; warnings, when not using `coreutils' version of 'ls' on OS X.
|
|
|
|
;; See brew info coreutils
|
|
|
|
(when (executable-find "gls")
|
2015-05-10 05:15:00 +00:00
|
|
|
;; maybe absolute or relative name of the `ls' program used by
|
|
|
|
;; `insert-directory'.
|
2015-05-04 17:36:02 +00:00
|
|
|
(setq insert-directory-program "gls"
|
2015-07-06 13:43:20 +00:00
|
|
|
dired-listing-switches "-aBhl --group-directories-first")
|
|
|
|
))
|
2015-05-04 17:36:02 +00:00
|
|
|
|
2015-02-07 04:35:46 +00:00
|
|
|
(defun osx/init-pbcopy ()
|
|
|
|
(use-package pbcopy
|
2015-08-23 01:47:30 +00:00
|
|
|
:if (and (spacemacs/system-is-mac) (not (display-graphic-p)))
|
2015-02-08 04:27:50 +00:00
|
|
|
:init (turn-on-pbcopy)))
|
2015-06-03 08:26:40 +00:00
|
|
|
|
2015-07-06 12:17:24 +00:00
|
|
|
(defun osx/init-launchctl ()
|
|
|
|
(use-package launchctl
|
2015-08-23 01:47:30 +00:00
|
|
|
:if (spacemacs/system-is-mac)
|
2015-07-06 12:17:24 +00:00
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.plist$" . nxml-mode))
|
|
|
|
(evil-leader/set-key "al" 'launchctl))
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(evilify launchctl-mode launchctl-mode-map
|
|
|
|
(kbd "q") 'quit-window
|
|
|
|
(kbd "s") 'tabulated-list-sort
|
|
|
|
(kbd "g") 'launchctl-refresh
|
|
|
|
(kbd "n") 'launchctl-new
|
|
|
|
(kbd "e") 'launchctl-edit
|
|
|
|
(kbd "v") 'launchctl-view
|
|
|
|
(kbd "l") 'launchctl-load
|
|
|
|
(kbd "u") 'launchctl-unload
|
|
|
|
(kbd "r") 'launchctl-reload
|
|
|
|
(kbd "S") 'launchctl-start
|
|
|
|
(kbd "K") 'launchctl-stop
|
|
|
|
(kbd "R") 'launchctl-restart
|
|
|
|
(kbd "D") 'launchctl-remove
|
|
|
|
(kbd "d") 'launchctl-disable
|
|
|
|
(kbd "E") 'launchctl-enable
|
|
|
|
(kbd "i") 'launchctl-info
|
|
|
|
(kbd "f") 'launchctl-filter
|
|
|
|
(kbd "=") 'launchctl-setenv
|
|
|
|
(kbd "#") 'launchctl-unsetenv
|
|
|
|
(kbd "h") 'launchctl-help))))
|
|
|
|
|
2015-08-07 22:09:30 +00:00
|
|
|
(defun osx/init-reveal-in-osx-finder ()
|
2015-08-04 06:58:05 +00:00
|
|
|
(use-package reveal-in-osx-finder
|
2015-08-23 01:47:30 +00:00
|
|
|
:if (spacemacs/system-is-mac)
|
2015-08-04 06:58:05 +00:00
|
|
|
:commands reveal-in-osx-finder))
|