help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatically highlight all same occurrence of same stuff which has


From: Hongyi Zhao
Subject: Re: Automatically highlight all same occurrence of same stuff which has been currently marked/selected.
Date: Sun, 21 May 2023 09:44:20 +0800

On Sun, May 21, 2023 at 9:14 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > Say, I have the following:
> >
> > foo ...
> > .. bar...
> > baz foo
> >
> > Then when I select one of the `foo` above, the two `foo`s will be
> > highlighted automatically. Any tips for achieving this?
>
> "high-lock.el" - in particular, M-x highlight-regexp ...?  Should even
> catch the region string as DEFAULT for the regexp (not regexp-quoted
> though).

The following packages do the trick:

(use-package idle-highlight-mode
  :config (setq idle-highlight-idle-time 0.2)
  (idle-highlight-global-mode)
  ;; :hook ((prog-mode text-mode) . idle-highlight-mode)
  )


(use-package symbol-overlay
  :config
  (symbol-overlay-mode)
  (global-set-key (kbd "M-i") 'symbol-overlay-put)
  (global-set-key (kbd "M-n") 'symbol-overlay-switch-forward)
  (global-set-key (kbd "M-p") 'symbol-overlay-switch-backward)
  ;; (global-set-key (kbd "<f7>") 'symbol-overlay-mode)
  (global-set-key (kbd "<f8>") 'symbol-overlay-remove-all)
  )


> Michael.

Zhao



reply via email to

[Prev in Thread] Current Thread [Next in Thread]