diff --git a/README.md b/README.md index 759245f..71f5478 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,11 @@ Add the following to your .emacs file: (global-set-key [(shift f3)] 'highlight-symbol-prev) (global-set-key [(meta f3)] 'highlight-symbol-query-replace) +Or turn on `global-highlight-symbol-mode` to enable it globally: + + (require 'highlight-symbol) + (global-highlight-symbol-mode 1) + Use `highlight-symbol` to toggle highlighting of the symbol at point throughout the current buffer. Use `highlight-symbol-mode` to keep the symbol at point highlighted. diff --git a/highlight-symbol.el b/highlight-symbol.el index afe6aab..02785d5 100644 --- a/highlight-symbol.el +++ b/highlight-symbol.el @@ -215,6 +215,10 @@ Highlighting takes place after `highlight-symbol-idle-delay'." (highlight-symbol-mode-remove-temp) (kill-local-variable 'highlight-symbol))) +;;;###autoload +(define-globalized-minor-mode global-highlight-symbol-mode highlight-symbol-mode + (lambda () (highlight-symbol-mode 1))) + ;;;###autoload (defalias 'highlight-symbol-at-point 'highlight-symbol)