Skip to content

Instantly share code, notes, and snippets.

@c02y
Created August 15, 2018 10:56
Show Gist options
  • Save c02y/fac99f12303f0a1226901b9debf31735 to your computer and use it in GitHub Desktop.
Save c02y/fac99f12303f0a1226901b9debf31735 to your computer and use it in GitHub Desktop.
comment line or region
;; (setq comment-style 'extra-line)
(add-hook 'c-mode-hook
(lambda ()
(set (make-local-variable 'rebox-style-loop) '(241 243 111))
(rebox-mode 1)))
(add-hook 'c++-mode-hook
(lambda ()
(set (make-local-variable 'rebox-style-loop) '(21 23 111))
(rebox-mode 1)))
;; FIXME: comment-dwim-2 doesn't work well with multiple line when comment-style is set to extra-line
;; So this function use comment-dwim-2 for single line, and rebox2 for multiple lines, with comment-tyle disabled
(bind-key* "M-;" 'comment-dwim-2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment