I'm using web-mode within emacs to edit an html file, in html-mode I can use C-c C-v
to render html, it opens the file straight to Firefox.
How I do that with web-mode?
Thanks a lot,
P.S : Using emacs 26.3
You can find out what C-c C-v
does by pressing F1 k C-c C-v
in a html-mode
buffer:
C-c C-v runs the command browse-url-of-buffer (found in html-mode-map), which is an interactive autoloaded compiled Lisp function in ‘browse-url.el’.
That command can be bound in the appropriate web-mode
keymap, aptly named web-mode-map
:
(with-eval-after-load 'web-mode
(define-key web-mode-map (kbd "C-c C-v") 'browse-url-of-buffer))
:bind ("C-c C-v" . browse-url-of-buffer)
to my use-package
and it works well.
Commented
Feb 7, 2020 at 23:15