瀏覽代碼

Treak some keybind

master
10sr 5 年之前
父節點
當前提交
44032ed459
簽署人: 10sr GPG Key ID: 7BEC428194130EB2
共有 1 個文件被更改,包括 13 次插入10 次删除
  1. +13
    -10
      emacs.el

+ 13
- 10
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))


Loading…
取消
儲存