I am trying to configure highlight-symbol
mode with use-package
for only programming modes. This is what I have:
(use-package highlight-symbol
:ensure t
:init
(add-hook 'prog-mode-hook
(lambda()
(highlight-symbol-mode 1)))
(add-hook 'prog-mode-hook
(lambda()
(highlight-symbol-nav-mode 1)))
:config
(setq highlight-symbol-idle-delay 1.0
highlight-symbol-on-navigation-p t)
:diminish highlight-symbol-mode)
However, when I open a .cpp file for example, I see that highlighting is not enabled (the minor mode is not enabled). I have also tried using lambda functions in the hooks to pass a non-nil argument, but that does not help. Invoking, M-x highlight-symbol-mode
on the buffer works as expected.
Any suggestion is appreciated.