2021-02-07 22:01:43 +00:00
|
|
|
;;; packages.el --- fasd Layer packages File for Spacemacs
|
|
|
|
;;
|
|
|
|
;; 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-03-09 14:34:37 +00:00
|
|
|
|
2021-02-07 22:01:43 +00:00
|
|
|
(defconst fasd-packages
|
|
|
|
'((helm-fasd :requires helm
|
|
|
|
:location (recipe :repo "ajsalminen/helm-fasd"
|
|
|
|
:fetcher github
|
|
|
|
:files ("*.el")))
|
|
|
|
(fasd :toggle (not (configuration-layer/layer-used-p 'helm)))))
|
2015-03-09 14:34:37 +00:00
|
|
|
|
2015-01-03 16:08:11 +00:00
|
|
|
(defun fasd/init-fasd ()
|
2016-04-05 10:52:54 +00:00
|
|
|
"initializes fasd-emacs and adds a key binding to `SPC f z'"
|
2015-01-03 16:08:11 +00:00
|
|
|
(use-package fasd
|
|
|
|
:init
|
|
|
|
(progn
|
2020-04-25 15:38:53 +00:00
|
|
|
(defun fasd-find-file-only ()
|
|
|
|
(interactive)
|
|
|
|
(fasd-find-file -1))
|
|
|
|
|
|
|
|
(defun fasd-find-directory-only ()
|
|
|
|
(interactive)
|
2020-09-11 00:57:50 +00:00
|
|
|
(fasd-find-file 2))
|
2020-04-25 15:38:53 +00:00
|
|
|
|
2015-01-03 16:08:11 +00:00
|
|
|
(global-fasd-mode 1)
|
2015-03-09 14:34:37 +00:00
|
|
|
(spacemacs/declare-prefix "fa" "fasd-find")
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys "fad" 'fasd-find-directory-only)
|
|
|
|
(spacemacs/set-leader-keys "faf" 'fasd-find-file-only)
|
|
|
|
(spacemacs/set-leader-keys "fas" 'fasd-find-file)
|
2015-03-09 14:34:37 +00:00
|
|
|
|
2021-02-07 22:01:43 +00:00
|
|
|
(when (configuration-layer/layer-used-p 'ivy)
|
|
|
|
(ivy-set-actions
|
|
|
|
'fasd-find-file
|
|
|
|
'(("o" fasd-find-file-action "find-file")
|
|
|
|
("s" ivy-search-from-action "search-from"))))
|
|
|
|
|
2015-03-09 14:34:37 +00:00
|
|
|
;; we will fall back to using the default completing-read function, which is helm once helm is loaded.
|
2020-04-25 15:38:53 +00:00
|
|
|
(setq fasd-completing-read-function 'nil))))
|
|
|
|
|
|
|
|
(defun fasd/init-helm-fasd ()
|
|
|
|
"initializes fasd-emacs and adds a key binding to `SPC f z'"
|
|
|
|
(use-package helm-fasd
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(spacemacs/declare-prefix "fa" "fasd find")
|
|
|
|
(spacemacs/set-leader-keys "fad" #'helm-fasd-directories)
|
|
|
|
(spacemacs/set-leader-keys "faf" #'helm-fasd-files)
|
|
|
|
(spacemacs/set-leader-keys "fas" #'helm-fasd))))
|