Skip to content

Instantly share code, notes, and snippets.

@genehack
Created May 8, 2010 16:30
Show Gist options
  • Save genehack/394635 to your computer and use it in GitHub Desktop.
Save genehack/394635 to your computer and use it in GitHub Desktop.
;;; TOGGLE-BOL
(defun jsja/bol-toggle ()
"Toggle between beginning of indent and beginning of line"
(interactive)
(let ((jsja-bol-command-name "jsja/bol-toggle"))
(setq this-command jsja-bol-command-name)
(cond ((equal (point) (point-at-bol)) (back-to-indentation))
((equal last-command jsja-bol-command-name) (move-beginning-of-line nil))
(t (back-to-indentation)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment