-
-
Save darrik/3179417 to your computer and use it in GitHub Desktop.
Do want
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defadvice newline-and-indent (after darrik-nai-curly-special activate) | |
"Do something special when RET between {}." | |
(when (eq (char-after) ?\}) | |
(let ((pos (point))) | |
(if (search-backward "{") | |
(progn | |
(goto-char pos) | |
(newline) | |
(indent-according-to-mode) | |
(previous-line) | |
(indent-according-to-mode)))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | is cursor position */ | |
if(blaha) {|} /* if I press enter while at | I want: */ | |
if(blaha) { /* this */ | |
| | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment