2020-02-19 23:07:30 +00:00
|
|
|
;;; packages.el --- OSX Layer packages File for Spacemacs
|
2016-08-28 11:20:44 +00:00
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 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.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2016-08-28 11:20:44 +00:00
|
|
|
|
2020-02-01 16:59:42 +00:00
|
|
|
(setq osx-packages
|
|
|
|
'(
|
|
|
|
helm
|
|
|
|
launchctl
|
|
|
|
(osx-dictionary :toggle osx-use-dictionary-app)
|
|
|
|
osx-trash
|
|
|
|
osx-clipboard
|
|
|
|
reveal-in-osx-finder
|
|
|
|
term
|
|
|
|
))
|
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
|
2019-10-13 05:27:17 +00:00
|
|
|
;; macOS Port)
|
2015-10-08 18:00:02 +00:00
|
|
|
(when (boundp 'mac-system-move-file-to-trash-use-finder)
|
2020-06-20 03:31:52 +00:00
|
|
|
(setq mac-system-move-file-to-trash-use-finder t))
|
2015-10-11 08:59:16 +00:00
|
|
|
|
2020-02-01 16:59:42 +00:00
|
|
|
;; 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
|
2020-06-20 03:31:52 +00:00
|
|
|
;; not using GNU ls.
|
|
|
|
(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-08-26 05:26:26 +00:00
|
|
|
(defun osx/init-osx-clipboard ()
|
|
|
|
(use-package osx-clipboard
|
|
|
|
:if (spacemacs/system-is-mac)
|
|
|
|
:commands
|
|
|
|
(osx-clipboard-paste-function osx-clipboard-cut-function)
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(setq interprogram-cut-function '(lambda (text &rest ignore)
|
2020-02-01 16:59:42 +00:00
|
|
|
(if (display-graphic-p)
|
|
|
|
(gui-select-text text)
|
|
|
|
(osx-clipboard-cut-function text)))
|
2018-08-26 05:26:26 +00:00
|
|
|
interprogram-paste-function '(lambda ()
|
2020-02-01 16:59:42 +00:00
|
|
|
(if (display-graphic-p)
|
|
|
|
(gui-selection-value)
|
|
|
|
(osx-clipboard-paste-function)))))))
|
2016-01-26 05:47:10 +00:00
|
|
|
|
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)))
|