4 ms·
Every time I learn something about Emacs or incorporate someone's nifty elisp code, it pays off and keeps paying. Latest: ; CSS color values colored by them
by kirubakaran 17y ago
Every time I learn something about Emacs or incorporate someone's nifty elisp code, it pays off and keeps paying.
Latest:
; CSS color values colored by themselves
; http://xahlee.org/emacs/emacs_html.html
(defvar hexcolour-keywords
'(("#[abcdef[:digit:]]\\{6\\}"
(0 (put-text-property
(match-beginning 0)
(match-end 0)
'face (list :background
(match-string-no-properties 0)))))))
(defun hexcolour-add-to-font-lock ()
(font-lock-add-keywords nil hexcolour-keywords))
(add-hook 'css-mode-hook 'hexcolour-add-to-font-lock)
- gruseom 17y agoClever idea! Now I want to hear about some of your other favorites.
- kirubakaran 17y agoThank you. [re:Favorites] The best I can do for now: http://github.com/ki/my-dot-emacs/blob/master/dot-emacs.txt http://github.com/ki/my-dot-emacs/blob/master/dot-emacs.txt
- mapleoin 17y ago.txt?
- kirubakaran 17y agoJust a name :) It is ~/.emacs in my machine. http://github.com/ki/my-dot-emacs/raw/master/dot-emacs.txt http://github.com/ki/my-dot-emacs/raw/master/dot-emacs.txt
- jrockway 17y agoYou might prefer to manage your dotfiles with something like: http://github.com/jrockway/dotfiles/tree/master/bin http://github.com/jrockway/dotfiles/tree/master/bin
- kirubakaran 17y agoCool. Thanks!
- jacquesm 17y agoUntil you pick one that has the background colour by accident! Be weird to see that floating semicolon in there.
- kirubakaran 17y agoThe #rrggbb text is still displayed with normal text color. So it will never look like a floating semicolon. Try it. It is not even a problem when #rrggbb color is same as the foreground, as I have (global-hl-line-mode 1)