Skip to content

Instantly share code, notes, and snippets.

@Pitometsu
Created October 22, 2013 14:14
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 Pitometsu/7101488 to your computer and use it in GitHub Desktop.
Save Pitometsu/7101488 to your computer and use it in GitHub Desktop.
postfix whitespace
;; insert postfix whitespace
(defun insert-postfix-whitespace ()
"Just insert SPC symbol next to point."
(interactive)
(save-excursion
(insert ?\s)
(backward-char)))
;; whitespace next to cursor
(global-set-key (kbd "S-SPC") 'insert-postfix-whitespace)
@magnars
Copy link

magnars commented Oct 23, 2013

You don't have to do backward-char, since save-excursion will take you back to your original position anyway. :)

I'm adding this to my .emacs.d and seeing how I like it. Thanks for the tip!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment