Skip to content

Instantly share code, notes, and snippets.

@fakedrake
Created November 6, 2012 17:16
Show Gist options
  • Save fakedrake/4026108 to your computer and use it in GitHub Desktop.
Save fakedrake/4026108 to your computer and use it in GitHub Desktop.
(defun my-cc-newline-and-indent ()
"If we are between braces (that were mos probably created by
electric-pairs) prepare for writing the body of something"
(interactive)
(if (and (looking-at "}") (looking-back "{"))
(progn (newline-and-indent) (newline-and-indent) (previous-line) (c-indent-line-or-region))
(newline-and-indent)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment