I am using web-mode 20161003.1327
At the moment when I comment a region in web-mode, it comments like this;
/* import chai from 'chai';
* import 'babel-polyfill';
* import configureMockStore from 'redux-mock-store';
* import thunk from 'redux-thunk';
* import * as ActionTypes from '../actions/ForecastActions';
*
* const expect = chai.expect;
*
* const middlewares = [ thunk ];
* const mockStore = configureMockStore(middlewares);
*
* /
This is not good for uncommenting only a section.
Can I change the commenting to use double forward slash?
I've tried using (setq web-mode-comment-style 2)
but this appears to do nothing.
I have also tried web-mode-comment-formats
but it also does not appear to work:
(require 'web-mode)
(add-to-list 'web-mode-comment-formats '("javascript" . "//"))
(defun my-web-mode-hook ()
"web-mode settings"
(setq web-mode-markup-indent-offset 2)
(setq web-mode-css-indent-offset 2)
(setq web-mode-code-indent-offset 2))
(add-hook 'web-mode-hook 'my-web-mode-hook)
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.js?$" . web-mode))
web-mode-comment-formats
. I think this is the proper variable for what you want.