From b2becc55a2ef6fb3faef12cd60bc1b116d8c85f2 Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Thu, 14 Mar 2019 14:57:43 +0900 Subject: [PATCH] Add my-fzf-or-find-file --- emacs.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index 64ce082..5930a2b 100644 --- a/emacs.el +++ b/emacs.el @@ -760,7 +760,14 @@ found, otherwise returns nil." "cut -b3-"))) (setenv "FZF_DEFAULT_COMMAND" defcmd)) (set-variable 'fzf/window-height 45) - ;; (define-key ctl-x-map (kbd "C-f") 'fzf) + (defun my-fzf-or-find-file () + "Call fzf if usable or call find-file." + (declare (interactive-only t)) + (interactive) + (if (and (file-remote-p default-directory)) + (call-interactively 'find-file) + (fzf))) + (define-key ctl-x-map (kbd "C-f") 'my-fzf-or-find-file) ) (when (safe-require-or-eval 'recently)