From 44032ed45963b1253fd1a8c8db36d2f2160e71b1 Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Thu, 14 Mar 2019 18:36:55 +0900 Subject: [PATCH] Treak some keybind --- emacs.el | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/emacs.el b/emacs.el index 5930a2b..52b8af7 100644 --- a/emacs.el +++ b/emacs.el @@ -760,15 +760,16 @@ found, otherwise returns nil." "cut -b3-"))) (setenv "FZF_DEFAULT_COMMAND" defcmd)) (set-variable 'fzf/window-height 45) - (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) ) +(defun my-fzf-or-find-file () + "Call fzf if usable or call find-file." + (declare (interactive-only t)) + (interactive) + (if (and (fboundp 'fzf) + (not (file-remote-p default-directory))) + (fzf) + (call-interactively 'find-file))) +(define-key ctl-x-map (kbd "f") 'my-fzf-or-find-file) (when (safe-require-or-eval 'recently) (recently-mode 1)) @@ -1630,7 +1631,9 @@ ARG is num to show, or defaults to 7." (define-key dired-mode-map "G" 'ignore) (define-key dired-mode-map "e" 'wdired-change-to-wdired-mode) (define-key dired-mode-map "i" 'dired-get-file-info) - (define-key dired-mode-map "f" 'find-file) + ;; (define-key dired-mode-map "f" 'find-file) + ;; (define-key dired-mode-map "z" 'fzf) + (define-key dired-mode-map "f" 'my-fzf-or-find-file) (define-key dired-mode-map "!" 'shell-command) (define-key dired-mode-map "&" 'async-shell-command) (define-key dired-mode-map "X" 'dired-do-async-shell-command) @@ -1703,7 +1706,7 @@ ARG is num to show, or defaults to 7." "")) ) -(define-key ctl-x-map (kbd "f") 'my-dired-git-ls-files) +(define-key ctl-x-map (kbd "G") 'my-dired-git-ls-files) (with-eval-after-load 'dired (defvar dired-mode-map (make-sparse-keymap)) (define-key dired-mode-map "G" 'my-dired-git-ls-files))