(require 'web-mode) (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)) ;; indent setting (defun my-web-mode-hook () "Hooks for Web mode." (setq web-mode-markup-indent-offset 2) ) (add-hook 'web-mode-hook 'my-web-mode-hook) ;; comment style setting (setq web-mode-comment-style 2)
C-c C-v runs the command browse-url-of-buffer, which is an interactive compiled Lisp function. It is bound to C-c C-v, <menu-bar> <html> <browse-url-of-buffer>. (browse-url-of-buffer &optional BUFFER) Ask a WWW browser to display BUFFER. Display the current buffer if BUFFER is nil. Display only the currently visible part of BUFFER (from a temporary file) if buffer is narrowed.
(defun web-mode-keybinding-settings () "Settings for keybinding." (eal-define-keys '(web-mode-map) '(("C-c C-v" browse-url-of-file)))) (eval-after-load "web-mode-keybinding-settings" '(web-mode-keybinding-settings))
(require 'web-mode) (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)) ;; indent setting (defun my-web-mode-hook () "Hooks for Web mode." (setq web-mode-markup-indent-offset 2) ) (add-hook 'web-mode-hook 'my-web-mode-hook) ;; comment style setting (setq web-mode-comment-style 2) ;; keybinding (defun web-mode-keybinding-settings () "Settings for keybinding." (eal-define-keys '(web-mode-map) '(("C-c C-v" browse-url-of-file)))) (eval-after-load "web-mode-keybinding-settings" '(web-mode-keybinding-settings)) (provide 'web-settings)
原文地址:http://blog.csdn.net/one___thousand/article/details/43926697