Ver a proveniência

Simplify

master
10sr há 5 anos
ascendente
cometimento
b7a42d8a53
Assinados por: 10sr ID da chave GPG: 7BEC428194130EB2
1 ficheiros alterados com 32 adições e 29 eliminações
  1. +32
    -29
      emacs.el

+ 32
- 29
emacs.el Ver ficheiro

@@ -734,43 +734,46 @@ found, otherwise returns nil."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; file handling

(when (and (autoload-eval-lazily 'fzf)
(executable-find "fzf"))
;; Too slow!
;; (set-variable 'fzf/executable "sk")
;; (set-variable 'fzf/args "--color bw --print-query")
;; Modified from hardcoded default to include:
;; - directories
;; - hidden files
;; - root directory (.)
;; - parent directory (..)
(let* ((find (if (executable-find "bfs")
;; Breadth-first find https://github.com/tavianator/bfs
"bfs"
"find"))
(defcmd (concat "set -eu; set -o pipefail; "
"echo .; "
"echo ..; "
"command " find " -L . "
"-mindepth 1 "
"\\( -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune "
"-o -print "
"2> /dev/null "
"| "
"cut -b3-")))
(setenv "FZF_DEFAULT_COMMAND" defcmd))
(set-variable 'fzf/window-height 45)
)
;; fzf
;; Too slow!
;; (set-variable 'fzf/executable "sk")
;; (set-variable 'fzf/args "--color bw --print-query")
;; Modified from hardcoded default to include:
;; - directories
;; - hidden files
;; - root directory (.)
;; - parent directory (..)
(let* ((find (if (executable-find "bfs")
;; Breadth-first find https://github.com/tavianator/bfs
"bfs"
"find"))
(defcmd (concat "set -eu; set -o pipefail; "
"echo .; "
"echo ..; "
"command " find " -L . "
"-mindepth 1 "
"\\( -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune "
"-o -print "
"2> /dev/null "
"| "
"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 (fboundp 'fzf)
(if (and (executable-find "fzf")
(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)

;; recently

(when (safe-require-or-eval 'recently)
(recently-mode 1))

@@ -1632,8 +1635,8 @@ ARG is num to show, or defaults to 7."
(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 "z" 'fzf)
(define-key dired-mode-map "f" 'my-fzf-or-find-file)
(define-key dired-mode-map "z" 'fzf)
(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)


Carregando…
Cancelar
Guardar