2 Commits

Author SHA1 Message Date
  10sr 04afa159a6
Add fuzzy isearch config 2 years ago
  10sr f70a964541
Update rg command 2 years ago
1 changed files with 14 additions and 8 deletions
Split View
  1. +14
    -8
      emacs.el

+ 14
- 8
emacs.el View File

@@ -450,13 +450,19 @@ Otherwize hook it."

;; (global-set-key (kbd "C-s") 'isearch-forward-regexp)
;; (global-set-key (kbd "C-r") 'isearch-backward-regexp)
(set-variable 'search-default-mode t)
;; TODO: Do not depend on ivy function
;; (set-variable 'search-default-mode
;; (lambda (str lax)
;; (ivy--regex-fuzzy (replace-regexp-in-string (rx (one-or-more whitespace))
;; ""
;; str))))
(if (eval-and-compile (require 'prescient nil t))
(set-variable 'search-default-mode
(lambda (orig lax)
(prescient-fuzzy-regexp orig)))
(set-variable 'search-default-mode t))
;; (set-variable 'search-whitespace-regexp ".*?")
;; (set-variable 'isearch-regexp-lax-whitespace t)
;; (replace-regexp-in-string "\n" "" (prescient-fuzzy-regexp "abc"))
;; (string-match-p (prescient-fuzzy-regexp "abc") "aaa\nbc")
;; (isearch-symbol-regexp "abc def" nil)
;; (isearch-symbol-regexp "abc def" t)
;; (word-search-regexp "abc def" nil)
;; (word-search-regexp "abc def" t)

(when (fboundp 'undo-fu-only-undo)
(global-set-key (kbd "C-_") 'undo-fu-only-undo))
@@ -2581,7 +2587,7 @@ condition to choose COMMAND when evaluated.")
;; ripgrep
("rg"
(executable-find "rg")
"rg -nH --no-heading --hidden --glob '!.git/' --smart-case -M 1280 ")
"rg -nH --no-heading --hidden --no-ignore-parent --glob '!.git/' --smart-case -M 1280 ")

;; git grep
("gitgrep"


Loading…
Cancel
Save