Add search-from ivy action to fasd layer

If I had known about browsing history with `C-r` before [I modified the fasd
package to implement full ivy
support](c4c04873fd),
then I guess I would not have modified it. Anyway, now that "full Ivy support"
has been merged into the fasd package, I could add this 'search-from' action
command to `fasd-find-file` which triggers Spacemacs 'search-auto'. Because fasd
only finds dirs that have been visited before, it probably does not add much to
the `C-r` functionality, but maybe it does (you decide?). Anyway, I hope you can
help decide if this is useful for merging.
This commit is contained in:
Daniel Nicolai 2020-12-31 01:07:57 +01:00 committed by Maximilian Wolff
parent ea58a79715
commit dfd5532429
No known key found for this signature in database
GPG Key ID: 2DD07025BFDBD89A
3 changed files with 20 additions and 0 deletions

View File

@ -1984,6 +1984,8 @@ Other:
- Support running graphical Factor listener instances from Spacemacs
- Support reloading factor-mode/fuel-mode code when connecting to different
Factor versions
**** FASD
- Add ~search from~ ivy action (thanks to Daniel Nicolai)
**** Finance
- Remove key-bindings pointing to removed commands (thanks to Alexander Baier)
- Added =evil-ledger= package (thanks to Alexander Miller)

View File

@ -8,6 +8,7 @@
- [[#install][Install]]
- [[#layer][Layer]]
- [[#fasd][fasd]]
- [[#comment][Comment]]
- [[#key-bindings][Key bindings]]
* Description
@ -34,6 +35,13 @@ On macOS, it can be installed via [[https://github.com/Homebrew/legacy-homebrew]
$ brew install fasd
#+END_SRC
* Comment
The fasd package has been updated to support Ivy actions (~M-o~). This layer
adds an Ivy action to start a deep search in a directory
(~spacemacs/search-auto~) from the fasd results. After the fasd query,
instead of enter, type ~M-o~ on some directory then press ~s~ to start a
deep search in that directory.
* Key bindings
| Key binding | Description |

View File

@ -0,0 +1,10 @@
(with-eval-after-load 'fasd
(defun ivy-search-from-action (x)
(if (file-directory-p x)
(spacemacs/counsel-search dotspacemacs-search-tools nil x)
(message "Selected item is not a directory path")))
(ivy-set-actions
'fasd-find-file
'(("o" fasd-find-file-action "find-file")
("s" ivy-search-from-action "search-from"))))