2015-07-15 07:43:27 +00:00
|
|
|
;;; packages.el --- ranger Layer packages File for Spacemacs
|
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2015-07-15 07:43:27 +00:00
|
|
|
;;
|
|
|
|
;; Author: Rich Alesi
|
|
|
|
;; 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/>.
|
|
|
|
|
2015-07-15 07:43:27 +00:00
|
|
|
|
2016-04-07 22:33:43 +00:00
|
|
|
(setq ranger-packages
|
|
|
|
'(
|
|
|
|
(dired :location built-in)
|
2017-01-11 17:58:03 +00:00
|
|
|
golden-ratio
|
2016-04-07 22:33:43 +00:00
|
|
|
ranger
|
|
|
|
))
|
2015-07-15 07:43:27 +00:00
|
|
|
|
2016-04-05 11:35:01 +00:00
|
|
|
(defun ranger//set-leader-keys ()
|
2020-06-21 22:04:52 +00:00
|
|
|
(spacemacs/declare-prefix "atr" "ranger/deer")
|
2016-04-05 11:35:01 +00:00
|
|
|
(spacemacs/set-leader-keys
|
2020-06-21 22:04:52 +00:00
|
|
|
"atrr" 'ranger
|
|
|
|
"atrd" 'deer
|
2016-12-11 20:17:42 +00:00
|
|
|
"jD" 'deer-jump-other-window
|
|
|
|
"jd" 'deer))
|
2016-04-05 11:35:01 +00:00
|
|
|
|
2015-07-15 07:43:27 +00:00
|
|
|
(defun ranger/init-ranger ()
|
|
|
|
(use-package ranger
|
2016-12-11 20:17:42 +00:00
|
|
|
:commands (ranger deer deer-jump-other-window ranger-override-dired-mode)
|
2015-07-15 07:43:27 +00:00
|
|
|
:init
|
2015-07-28 00:52:58 +00:00
|
|
|
(progn
|
2016-04-05 11:35:01 +00:00
|
|
|
(ranger//set-leader-keys)
|
2016-12-11 20:17:42 +00:00
|
|
|
|
2020-10-29 11:11:04 +00:00
|
|
|
(when (memq ranger-enter-with-minus '(deer ranger))
|
|
|
|
(define-key evil-motion-state-map (kbd "-") ranger-enter-with-minus))
|
2016-12-11 20:17:42 +00:00
|
|
|
|
2015-08-28 06:09:04 +00:00
|
|
|
;; set up image-dired to allow picture resize
|
|
|
|
(setq image-dired-dir (concat spacemacs-cache-directory "image-dir"))
|
|
|
|
(unless (file-directory-p image-dired-dir)
|
2015-09-01 05:48:13 +00:00
|
|
|
(make-directory image-dired-dir)))
|
|
|
|
:config
|
2019-05-26 16:45:00 +00:00
|
|
|
(progn
|
|
|
|
(when (memq 'helm dotspacemacs-configuration-layers)
|
|
|
|
(require 'helm))
|
|
|
|
(define-key ranger-mode-map (kbd "-") 'ranger-up-directory))))
|
2016-04-05 11:04:51 +00:00
|
|
|
|
|
|
|
(defun ranger/post-init-dired ()
|
2016-04-05 11:35:01 +00:00
|
|
|
;; Be sure to override dired bindings
|
2017-04-28 14:22:16 +00:00
|
|
|
(ranger//set-leader-keys))
|
2017-01-11 17:58:03 +00:00
|
|
|
|
|
|
|
(defun ranger/post-init-golden-ratio ()
|
|
|
|
(with-eval-after-load 'golden-ratio
|
|
|
|
(add-to-list 'golden-ratio-exclude-modes "ranger-mode")))
|