Browse Source

Add fuzzy isearch config

master
10sr 3 years ago
parent
commit
04afa159a6
Signed by: 10sr GPG Key ID: 7BEC428194130EB2
1 changed files with 12 additions and 9 deletions
  1. +12
    -9
      emacs.el

+ 12
- 9
emacs.el View File

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


;; (global-set-key (kbd "C-s") 'isearch-forward-regexp) ;; (global-set-key (kbd "C-s") 'isearch-forward-regexp)
;; (global-set-key (kbd "C-r") 'isearch-backward-regexp) ;; (global-set-key (kbd "C-r") 'isearch-backward-regexp)
(set-variable 'search-default-mode t)
(set-variable 'search-whitespace-regexp ".*?")
(set-variable 'isearch-regexp-lax-whitespace t)
(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")) ;; (replace-regexp-in-string "\n" "" (prescient-fuzzy-regexp "abc"))
;; 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))))
;; (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) (when (fboundp 'undo-fu-only-undo)
(global-set-key (kbd "C-_") 'undo-fu-only-undo)) (global-set-key (kbd "C-_") 'undo-fu-only-undo))


Loading…
Cancel
Save