2016-08-28 11:20:44 +00:00
|
|
|
;;; config.el --- OSX Layer packages File for Spacemacs
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2016-08-28 11:20:44 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-04-19 03:40:24 +00:00
|
|
|
(setq osx-packages
|
2015-10-11 08:59:16 +00:00
|
|
|
'(
|
|
|
|
exec-path-from-shell
|
2016-01-26 05:47:10 +00:00
|
|
|
helm
|
|
|
|
launchctl
|
2016-08-27 15:28:27 +00:00
|
|
|
(osx-dictionary :toggle osx-use-dictionary-app)
|
2015-10-11 08:59:16 +00:00
|
|
|
osx-trash
|
|
|
|
pbcopy
|
|
|
|
reveal-in-osx-finder
|
2016-01-24 16:55:11 +00:00
|
|
|
term
|
2015-10-11 08:59:16 +00:00
|
|
|
))
|
2015-02-07 04:35:46 +00:00
|
|
|
|
2015-08-23 01:47:30 +00:00
|
|
|
(when (spacemacs/system-is-mac)
|
2015-10-08 18:00:02 +00:00
|
|
|
;; Enable built-in trash support via finder API if available (only on Emacs
|
|
|
|
;; Mac Port)
|
|
|
|
(when (boundp 'mac-system-move-file-to-trash-use-finder)
|
2015-10-11 08:59:16 +00:00
|
|
|
(setq mac-system-move-file-to-trash-use-finder t)))
|
|
|
|
|
|
|
|
(defun osx/post-init-exec-path-from-shell ()
|
|
|
|
;; Use GNU ls as `gls' from `coreutils' if available. Add `(setq
|
|
|
|
;; dired-use-ls-dired nil)' to your config to suppress the Dired warning when
|
|
|
|
;; not using GNU ls. We must look for `gls' after `exec-path-from-shell' was
|
|
|
|
;; initialized to make sure that `gls' is in `exec-path'
|
|
|
|
(when (spacemacs/system-is-mac)
|
|
|
|
(let ((gls (executable-find "gls")))
|
|
|
|
(when gls
|
|
|
|
(setq insert-directory-program gls
|
|
|
|
dired-listing-switches "-aBhl --group-directories-first")))))
|
2015-05-04 17:36:02 +00:00
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
(defun osx/pre-init-helm ()
|
|
|
|
;; Use `mdfind' instead of `locate'.
|
|
|
|
(when (spacemacs/system-is-mac)
|
|
|
|
(spacemacs|use-package-add-hook helm
|
|
|
|
:post-config
|
|
|
|
;; Disable fuzzy matchting to make mdfind work with helm-locate
|
|
|
|
;; https://github.com/emacs-helm/helm/issues/799
|
|
|
|
(setq helm-locate-fuzzy-match nil)
|
|
|
|
(setq helm-locate-command "mdfind -name %s %s"))))
|
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)
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-07-06 12:17:24 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2016-03-14 21:25:19 +00:00
|
|
|
(add-to-list 'auto-mode-alist '("\\.plist\\'" . nxml-mode))
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys "al" 'launchctl))
|
2015-07-06 12:17:24 +00:00
|
|
|
:config
|
|
|
|
(progn
|
2015-11-21 10:07:14 +00:00
|
|
|
(evilified-state-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-07-06 12:17:24 +00:00
|
|
|
|
2016-08-27 15:28:27 +00:00
|
|
|
(defun osx/init-osx-dictionary ()
|
|
|
|
(use-package osx-dictionary
|
|
|
|
:if osx-use-dictionary-app
|
|
|
|
:init (spacemacs/set-leader-keys "xwd" 'osx-dictionary-search-pointer)
|
2016-08-28 10:38:34 +00:00
|
|
|
:commands (osx-dictionary-search-pointer
|
|
|
|
osx-dictionary-search-input
|
|
|
|
osx-dictionary-cli-find-or-recompile)
|
2016-08-27 15:28:27 +00:00
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(evilified-state-evilify-map osx-dictionary-mode-map
|
|
|
|
:mode osx-dictionary-mode
|
|
|
|
:bindings
|
|
|
|
"q" 'osx-dictionary-quit
|
|
|
|
"r" 'osx-dictionary-read-word
|
|
|
|
"s" 'osx-dictionary-search-input
|
|
|
|
"o" 'osx-dictionary-open-dictionary.app))))
|
|
|
|
|
2016-01-26 05:47:10 +00:00
|
|
|
(defun osx/init-osx-trash ()
|
|
|
|
(use-package osx-trash
|
|
|
|
:if (and (spacemacs/system-is-mac)
|
|
|
|
(not (boundp 'mac-system-move-file-to-trash-use-finder)))
|
|
|
|
:init (osx-trash-setup)))
|
|
|
|
|
2018-03-31 05:07:08 +00:00
|
|
|
;; TODO: find a way to enable it in terminal with a dumped Spacemacs
|
|
|
|
;; if this package is activate while dumping it makes some action lag
|
|
|
|
;; like 'dd' to delete a line etc...
|
2016-01-26 05:47:10 +00:00
|
|
|
(defun osx/init-pbcopy ()
|
|
|
|
(use-package pbcopy
|
2018-03-31 05:07:08 +00:00
|
|
|
:if (and (spacemacs/system-is-mac)
|
|
|
|
(not (display-graphic-p))
|
|
|
|
(not (spacemacs-is-dumping-p)))
|
2016-01-26 05:47:10 +00:00
|
|
|
:init (turn-on-pbcopy)))
|
|
|
|
|
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))
|
2015-11-04 16:26:26 +00:00
|
|
|
|
2016-01-24 16:55:11 +00:00
|
|
|
(defun osx/post-init-term ()
|
|
|
|
(with-eval-after-load 'term
|
|
|
|
(define-key term-raw-map (kbd "s-v") 'term-paste)))
|