Global minor mode to highlight thing under point.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 4eadd17 Sep 19, 2017
Failed to load latest commit information. updates readme. #13 Sep 19, 2017
highlight-thing.el adds option to ignore strings. #13 Sep 19, 2017


Global minor mode to highlight the thing under point.

Similar to highlight-symbol-mode, but does not rely on font-lock functionality and does not provide functionality to navigate to different occurrences of the current symbol under point.

No external dependencies, uses thingatpt and hi-lock functionality that is included with GNU Emacs.


Basic setup:

(require 'highlight-thing)

Alternatively you can use the buffer-local version:

(add-hook 'prog-mode-hook 'highlight-thing-mode)

The default is to highlight the symbol under point, but you can customize hightlight-thing-what-thing to highlight different components. Set the following to only highlight the word under point:

(setq highlight-thing-what-thing 'word)

As an extension to the thing-at-point capabilities you can select region in which case an active region is used as the thing to highlight (cf. #7).

Customize the face hi-yellow to change the colors that are used for highlighting.

You can customize the delay before this mode attempts to highlight the thing under point. For example, push it out to 1.5 seconds from the default 0.5:

(setq highlight-thing-delay-seconds 1.5)

You can limit the highlighting of things to the current defun via the following setting:

(setq highlight-thing-limit-to-defun t)

You can configure the matching of occurrences to be case-sensitive via the following setting:

(setq highlight-thing-case-sensitive-p t)

If you want all the matches highlighted but not the one occurrence at the point itself, you can do so by:

;; Don't highlight the thing at point itself. Default is nil.
(setq highlight-thing-exclude-thing-under-point t)

If you want to highlight the current region when active or thing at point when inactive:

(setq highlight-thing-prefer-active-region t)

If you want to prevent highlighting certain strings:

(setq highlight-thing-ignore-list '("False" "True"))