From 15555bb7f4bcbbe8cc58ac2456ea17e321393e75 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 13 Oct 2023 16:16:40 +0300 Subject: emacs:(tools) Redo thanos/search with anonymous functions --- .emacs.d/modules/thanos-tools.el | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to '.emacs.d') diff --git a/.emacs.d/modules/thanos-tools.el b/.emacs.d/modules/thanos-tools.el index 9d58d75..15841cd 100644 --- a/.emacs.d/modules/thanos-tools.el +++ b/.emacs.d/modules/thanos-tools.el @@ -78,13 +78,18 @@ (setf register-preview-delay 0.5 register-preview-function #'consult-register-format) -;; Consult custom functions -(defun thanos/library-search () - "Search for content at ~/Library using consult-find." - (interactive) - (consult-find "~/Library")) - -(define-key global-map (kbd "C-c s") 'thanos/library-search) +;; Consult custom lambda functions +(defvar-keymap thanos/consult-search + :doc "Search for files in common folders I regularly use with consult." + "l" #'(lambda () (interactive) (consult-find "~/Library")) + "m" #'(lambda () (interactive) (yeetube-mpv-play + (completing-read "Select video: " + (directory-files-recursively + "/mnt/external/medical-videos/" ".*\.mp4"))))) + +(define-key global-map (kbd "C-c s") #'(lambda ()(message "hello"))) + +(define-key global-map (kbd "C-c s") thanos/consult-search) (defun insert-brackets (&optional arg) "Insert ARG brackets." -- cgit v1.2.3