From 76820964f82693d6c190296c7139df45180b3a5d Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Sat, 11 Jan 2020 20:41:14 +0900 Subject: [PATCH] Add my-counsel-recently --- emacs.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/emacs.el b/emacs.el index 5138e4b..9f5cdd7 100644 --- a/emacs.el +++ b/emacs.el @@ -2644,6 +2644,23 @@ Any output will be written to current buffer." ;; (setq mozc-candidate-style 'overlay) ;; (setq mozc-candidate-style 'echo-area) +(defvar my-cousel-recently-history nil "History of `my-counsel-recently'.") + +(when (and (require 'recently nil t) + (fboundp 'ivy-read)) + (defun my-counsel-recently () + "Consel `recently'." + (interactive) + (ivy-read "Recently: " (recently-list) + :require-match t + :history 'my-cousel-recently-history + :preselect default-directory + :action (lambda (x) (find-file x)) + :caller 'my-counsel-recently)) + + (define-key ctl-x-map (kbd "C-r") 'my-counsel-recently) + ) + ;; Local Variables: ;; flycheck-disabled-checkers: (emacs-lisp-checkdoc)