emacs写html,能不能自动缩进?
能不能像写c一样有格式化的功能?
所有mode的自动格式化功能都是C-M-\, 或者M-x indent-according-to-mode
C-x h
有html-mode的,网上找找很多的
写html的3个mode差不多了
html-mode css-mode javascript-mode
我使用的是web-mode
web-mode
;; web-mode (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.css\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.js\\'" . web-mode)) (require 'web-mode) (setq web-mode-markup-indent-offset 2) (setq web-mode-css-indent-offset 2) (setq web-mode-code-indent-offset 2)
(defun indent-buffer () "Indent current buffer." (interactive) (indent-region (point-min) (point-max)) (delete-trailing-whitespace) (unless indent-tabs-mode (untabify-buffer)) (message "Buffer indented: %s" (buffer-name)))
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(5)
所有mode的自动格式化功能都是C-M-\, 或者M-x indent-according-to-mode
C-x h
选中整个文件, 按 TAB,就会把整个文件的格式调整好。有html-mode的,网上找找很多的
写html的3个mode差不多了
我使用的是
web-mode