Skip to content

Instantly share code, notes, and snippets.

@tbielawa
Created September 27, 2010 01:10
Show Gist options
  • Save tbielawa/598459 to your computer and use it in GitHub Desktop.
Save tbielawa/598459 to your computer and use it in GitHub Desktop.
(defun insert-date ()
"Insert a time-stamp according to locale's date and time format."
(interactive)
(insert (format-time-string "%a, %e %b %Y, %k:%M" (current-time))))
(global-set-key "\C-cd" 'insert-date)
(defun indent-buffer ()
"Indents an entire buffer using the default intenting scheme."
(interactive)
(point-to-register 'o)
(delete-trailing-whitespace)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max))
(jump-to-register 'o))
(global-set-key "\C-x\\" 'indent-buffer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment