diff --git a/modules/config/default/config.el b/modules/config/default/config.el index 7c8f6e82b..ede24a339 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -64,12 +64,20 @@ (sp-local-pair (append sp--html-modes '(markdown-mode gfm-mode)) "" :actions '(insert) :post-handlers '(("| " "SPC"))) + ;; Expand C-style doc comment blocks + (defun +default-expand-doc-comment-block (&rest _ignored) + (let ((indent (current-indentation))) + (newline-and-indent) + (save-excursion + (newline) + (insert (make-string indent 32) " */") + (delete-char 2)))) (sp-local-pair '(js2-mode typescript-mode rjsx-mode rust-mode c-mode c++-mode objc-mode - java-mode php-mode css-mode scss-mode less-css-mode stylus-mode) + java-mode php-mode css-mode scss-mode less-css-mode stylus-mode) "/*" "*/" :actions '(insert) - :post-handlers '(("| " "SPC") ("|\n*/[i][d-2]" "RET") ("\n* ||\n*/[i][d-2]" "*"))) + :post-handlers '(("| " "SPC") ("|\n*/[i][d-2]" "RET") (+default-expand-doc-comment-block "*"))) ;; Highjacks backspace to: ;; a) balance spaces inside brackets/parentheses ( | ) -> (|)