1

I used highlight-symbol to show all selected text in spacemacs, but that looks not very good as sublime text did as following pic:

My question is that if spacemacs could use box style without color for other selected one? I knows most highlight el could use color to highlight all selected text, that is not good enough.

enter image description here

1
  • If you are stuck after defining @dalanicolai's hi-box, perhaps this way: (custom-set-faces '(isearch ((t (:inherit hi-box)))) '(lazy-highlight ((t (:inherit hi-box)))))
    – roomworoof
    Apr 23, 2023 at 3:13

1 Answer 1

1

You could define a simple face for this as follows:

(defface hi-box
  '((t (:box t )))
  "Box face for hi-lock mode."
  :group 'hi-lock-faces)

Then don't forget to add it as first element in hi-lock-face-defaults:

(add-to-list 'hi-lock-face-defaults "hi-box")

Note that you need to require hi-lock.el first for the variable to become available.

Subsequently, to further customize the face you can do M-x customize-face hi-box. There you can style the box to your liking.

2
  • when I added (add-to-list 'hi-lock-face-defaults "hi-box"), spacemacs shows error as following: (Spacemacs) Error in dotspacemacs/user-config: Symbol’s value as variable is void: hi-lock-faces
    – qbai
    Mar 24, 2023 at 0:04
  • Yeah, as I wrote in the answer, you have to place a (require 'hi-lock) before it (before the line with the 'add-to-list'). Mar 24, 2023 at 3:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.