I have mapped the shortcut
comment-region in my
(global-set-key "\C-cc" 'comment-region)
This works fine in all other modes but if I try to use it in web-mode I get
No comment syntax is defined. Use:. So, presumably, I need to tell web-mode to use
--> for HTML and
*/ for CSS. I checked some other mode files and I'm guessing I need something like this for CSS:
(let ((deactivate-mark nil) (comment-start "/*") (comment-end "*/"))
How should I go about editing my
web-mode.el to get my comments to work? Is the above line correct and, if so, where should I add it? Presumably, I would need to add the above (or something like it) to a CSS section of the file and the equivalent to an HTML one.
In the meantime, I would also appreciate a pointer explaining how I can give
--> as answers to the
No comment syntax is defined. Use: prompt.
I am aware of the
M-; shortcut from Web mode but I would rather have the same shortcut since I am very used to it from the various other modes I use where it works. In any case, I want the
comment-region function to work as it does in other modes.