Fork me on GitHub
#spacemacs
<
2020-01-03
>
Mario C.17:01:20

Certain words get color coded differently in comments such as TODO or NOTE . How can I add more words to the list of "comment keywords", for a lack of a better term?

practicalli-johnny20:01:31

@mario.cordova.862 I just read something about that the other day, I think I was looking through Font faces. I assume that is where it is. Maybe there is something in SPC SPC customize that might help you narrow down your seach?

practicalli-johnny20:01:22

If its just using org-mode configuration, then this is what I do to define states and colours https://github.com/practicalli/spacemacs-config/blob/master/.spacemacs.d/init.el#L654

practicalli-johnny20:01:16

@mario.cordova.862 It seems I found it. If you SPC SPC customize and search for todo in the cusomize buffer, it should take you to Global Hl Todo Mode and a list of other faces. In the Hl Todo Keyword Faces section, you can find an alist of existing keyworkds (text to highlight). You can change the colours and values of the keywords. At the bottom of the list in the Ins button, so you can add more. These are the same keywords as defined in https://github.com/tarsius/hl-todo/blob/master/hl-todo.el#L106 so I assume this project is used in Spacemacs. It should be possible to add code to the dotspacemacs/user-config in your .spacemacs file to set these programatically.

practicalli-johnny20:01:18

I just added this to the dotspacemacs/user-config section of my .spacemacs file and rebooted. It seems to work quite nicely. Keywords are case sensitive, so todo is different from TODO.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; Set Hightlight keywords

  (setq hl-todo-keyword-faces
        '(("TODO" . "SlateGray")
          ("DOING" . "DarkOrchid")
          ("BLOCKED" . "Firebrick")
          ("REVIEW" . "Teal")
          ("DONE" . "ForestGreen")
          ("ARCHIVED" .  "SlateBlue")))
  ;;
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Mario C.21:01:45

@jr0cket Thank you!! I couldn't figure what the right terms were to google this. Some solutions online didn't seem quite right! :thumbsup:

practicalli-johnny22:01:04

Terminology in Emacs is a whole new world, still much of an undiscovered country for me. I only had an idea because I had been playing around with the evaluation markers in the fringe, to make them stand out more (arriving in a pull request in the next week or so I hope). I would be interested to know what colours and keywords you find useful