2015-07-15 07:43:27 +00:00
|
|
|
;;; packages.el --- ranger Layer packages File for Spacemacs
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 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.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
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 ()
|
|
|
|
(spacemacs/set-leader-keys
|
|
|
|
"ar" 'ranger
|
2016-12-11 20:17:42 +00:00
|
|
|
"ad" 'deer
|
|
|
|
"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
|
|
|
|
|
|
|
;; allow '-' to enter ranger
|
|
|
|
(when ranger-enter-with-minus
|
|
|
|
(define-key evil-normal-state-map (kbd "-") 'deer))
|
|
|
|
|
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
|
2015-09-07 21:58:05 +00:00
|
|
|
(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")))
|