Skip to content

Instantly share code, notes, and snippets.

@banister
Last active December 17, 2015 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save banister/5640901 to your computer and use it in GitHub Desktop.
Save banister/5640901 to your computer and use it in GitHub Desktop.
;; ensure tabs are specially colored, since they mess up things in
;; langs like coffeescript
(defface extra-whitespace-face
'((t (:background "pale green")))
"Used for tabs and such.")
(defvar my-extra-keywords
'(("\t" . 'extra-whitespace-face)))
;; coffeescript specific hooks
(defun coffee-init ()
(font-lock-add-keywords nil my-extra-keywords)
(define-key coffee-mode-map
;; move point forward a line and to indent level of prev line
(kbd "C-j") (lambda () (interactive)
(newline)
(let ((col (save-excursion (forward-line -1)
(beginning-of-line)
(skip-syntax-forward "-"))))
(indent-to col))))
(hungry-delete-mode 1))
(add-hook 'coffee-mode-hook
'coffee-init)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment