Skip to content

Emacs minor mode to highlight search results in all the buffeer until you clear them or make another, like Vim hlsearch option.

License

Notifications You must be signed in to change notification settings

naclander/evil-search-highlight-persist

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 

Repository files navigation

Emacs Evil-Search-Highlight-Persist Minor Mode

http://melpa.milkbox.net/packages/evil-search-highlight-persist-badge.svg

This is a fork of the original, unmaintained, evil-search-highlight-persist.

This Emacs extension will make isearch and evil-ex-search-incremental (the “slash search”) to highlight the search term (taken as a regexp) in all the buffer and persistently until you make another search or clear the highlights with the search-highlight-persist-remove-all command (default binding to C-x SPC). This is how Vim search works by default when you enable hlsearch. This extension requires the “highlight” extension.

http://i.imgur.com/mwANxIA.png

Usage

To enable:

(require 'highlight)
(require 'evil-search-highlight-persist)
(global-evil-search-highlight-persist t)

To only highlight strings whose length is great than or equal to 3

(setq evil-search-highlight-string-min-len 3)

To change the default highlight face:

(set-face-background 'evil-ex-lazy-highlight "gold")
(set-face-foreground 'evil-ex-lazy-highlight "black")

To enable highlighting ( and un-highlighting ) across all windows, similiar to what Vim does:

(setq evil-search-highlight-persist-all-windows t)

Alternatives

This behavior is built-in to Evil if one if using the evil-search module:

(setq evil-search-module 'evil-search)

However, this is not available when using isearch, which I beleive provides a superior searching experience. This package also provides the benefit of being able to highlight all current windows, simliar to what Vim does.

In my opinion, this package would be made obsolete if evil-search was tweaked to behave more like isearch, and once evil supports highlighting across all windows.

About

Emacs minor mode to highlight search results in all the buffeer until you clear them or make another, like Vim hlsearch option.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Emacs Lisp 100.0%