0
1
I have added web-beautify-* to Emacs 24, so that I can run M-x web-beautify-js to pretty format my javascript source code.
I have add some keybindings for html-mode and css-mode, which work fine.
(eval-after-load 'sgml-mode
'(define-key html-mode-map (kbd "C-c b") 'web-beautify-html))
(eval-after-load 'css-mode
'(define-key css-mode-map (kbd "C-c b") 'web-beautify-css))
However the following snippet for js-mode and javascript-mode don't work.
(eval-after-load 'javascript-mode
'(define-key js-mode-map (kbd "C-c b") 'web-beautify-js))
(eval-after-load 'js-mode
'(define-key js-mode-map (kbd "C-c b") 'web-beautify-js))
How can I add custom keybindings to js-mode and javascript-mode?