Skip to content

Instantly share code, notes, and snippets.

@jasonrobot
Created April 7, 2018 07:01
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 jasonrobot/3319d86728530c559c7ead88a18dd6ca to your computer and use it in GitHub Desktop.
Save jasonrobot/3319d86728530c559c7ead88a18dd6ca to your computer and use it in GitHub Desktop.
(defun beginning-of-line-or-indentation ()
"Move to beginning of line, or indentation."
(interactive)
(let ((start (point)))
(back-to-indentation)
;; now if point is the same as when we started, we're already at indent start
(if (= start (point))
(beginning-of-line))))
(global-set-key (kbd "C-a") 'beginning-of-line-or-indentation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment