What is the short-cut key for commenting region in C++ mode in emacs? -
What is the short-cut key for commenting region in C++ mode in emacs? -
in c mode, conveniently used m-; comment part /* */
style.
/* program: foo */ /* author: jando */ /* date: 19/06/2014 */ /* ... */
now come c++ mode, find m-; can comment line style //
.
// // comment line // // available here
may know key-binding in c++ mode of emacs comment part (/*...*/
)? need style write comments such source file header part (because company has format conform to).
thank in advance.
in c++ mode, variable comment-start
, comment-end
's value "// "
, ""
, while in c mode "/* "
, " */"
.
so can alter local variable attain same behaviour c mode, such as:
(set (make-local-variable 'comment-start) "/* ") (set (make-local-variable 'comment-end) " */")
you can add together .emacs
file,
(defun my-c++-mode-hook () (c-set-style "stroustrup") (set (make-local-variable 'comment-start) "/* ") (set (make-local-variable 'comment-end) " */")) (add-hook 'c++-mode-hook 'my-c++-mode-hook)
or just:
(add-hook 'c++-mode-hook (lambda () (setq comment-start "/* " comment-end " */")))
c++ emacs
Comments
Post a Comment