瀏覽代碼

Fix fuzzy-finder commands

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

+ 14
- 3
emacs.el 查看文件

@@ -1249,8 +1249,7 @@ THEM are function and its args."
(if (and (executable-find "fzf")
(fboundp 'fuzzy-finder)
(not (file-remote-p default-directory)))
;; TODO: Use projectile version
(fuzzy-finder)
(fuzzy-finder-find-files-projectile)
(call-interactively 'find-file)))
(define-key ctl-x-map "f" 'my-fuzzy-finder-or-find-file)

@@ -1259,9 +1258,21 @@ THEM are function and its args."
(interactive)
(unless (executable-find "rg")
(error "rg not found"))
(fuzzy-finder :input-command "rg -nH --no-heading --hidden --follow --glob '!.git/*' --color=always ^"))
(fuzzy-finder :input-command "rg -nH --no-heading --hidden --follow --glob '!.git/*' --color=always ^"
:action (lambda (results)
(dolist (result results)
(let* ((fields (split-string result ":"))
(file (pop fields))
(linenumber (pop fields)))
(find-file (expand-file-name file))
(when linenumber
(goto-char (point-min))
(forward-line (- (string-to-number linenumber) 1))
(back-to-indentation)))))))
(define-key ctl-x-map "S" 'my-fuzzy-finder-ripgrep-lines)

;; (fuzzy-finder :command "selecta")

;; recently

;; TODO: Enable after first visit file?


Loading…
取消
儲存