10sr 4 anni fa
parent
commit
027ae0482e
Firmato da: 10sr ID Chiave GPG: 7BEC428194130EB2
1 ha cambiato i file con 13 aggiunte e 9 eliminazioni
  1. +13
    -9
      emacs.el

+ 13
- 9
emacs.el Vedi File

@@ -1155,15 +1155,19 @@ THEM are function and its args."
(error "rg not found"))
(fuzzy-finder :input-command "rg -nH --no-heading --hidden --follow --glob '!.git/*' --color=always ^"
:action (lambda (results)
(let ((results (mapcar (lambda (result)
(let* ((fields (split-string result ":"))
(file (pop fields))
(linenumber (pop fields)))
(list :file file
:linenumber linenumber)))
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)))))))
(find-file (plist-get result :file))
(when (plist-get result :linenumber)
(goto-char (point-min))
(forward-line (- (string-to-number (plist-get result :linenumber)) 1))
(back-to-indentation)))))))
(define-key ctl-x-map "S" 'my-fuzzy-finder-ripgrep-lines)

(defun my-fuzzy-finder-dired ()
@@ -2952,7 +2956,7 @@ Any output will be written to current buffer."
(require 'counsel nil t)
(when (require 'ivy-prescient nil t)
(set-variable 'prescient-filter-method
'(fuzzy literal regexp initialism))
'(literal regexp initialism fuzzy prefix))
(ivy-prescient-mode 1)))




Caricamento…
Annulla
Salva