summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-11-09 11:50:22 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-11-09 11:50:22 +0100
commitabb04c520b7e68f4f05c3d65b012715a1cfc6365 (patch)
treec46d702f29d3dc9a57458c30db51415d01c323d0 /.config
parentb5074b1973eed0cb1fac0e8081ad6090dfce3eb1 (diff)
emacs: Add commenting configuration
Diffstat (limited to '.config')
-rw-r--r--.config/emacs/modules/mm-editing.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/.config/emacs/modules/mm-editing.el b/.config/emacs/modules/mm-editing.el
index 6fbb44f..1b75649 100644
--- a/.config/emacs/modules/mm-editing.el
+++ b/.config/emacs/modules/mm-editing.el
@@ -118,15 +118,20 @@ those should be listed in `mm-editing-indentation-settings'."
(set (make-local-variable extra) tabsize)))))
-;;; Make Tab Not Suck
+;;; Code Commenting
-(use-package indent
- :custom
- (tab-always-indent t))
+(defun mm-c-comment-no-leading-stars ()
+ (setq-local comment-continue " "))
-(use-package electric
+(use-package newcomment
+ :custom
+ (comment-style 'multi-line)
:config
- (setq-default electric-indent-inhibit t))
+ (dolist (mode '(c-mode c++-mode))
+ (add-hook (mm-mode-to-hook mode) #'mm-c-comment-no-leading-stars)
+ (when-let ((ts-mode (mm-mode-to-ts-mode mode))
+ ((fboundp ts-mode)))
+ (add-hook (mm-mode-to-hook ts-mode) #'mm-c-comment-no-leading-stars))))
;;; Multiple Cursors