Skip to content

Commit

Permalink
use web-mode instead of nxml-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Bin committed Oct 1, 2013
1 parent bdd28cc commit 376d1d9
Show file tree
Hide file tree
Showing 203 changed files with 42 additions and 43,294 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ You need to install some command line tools to use some features in Emacs. All t
* install by OS way

### tidy (html tidy program)
* needed by `nxml-mode`
* needed by `web-mode`
* install by OS way

### csslint
Expand Down
2 changes: 1 addition & 1 deletion init-auto-complete.el
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
;; extra modes auto-complete must support
(dolist (mode '(magit-log-edit-mode log-edit-mode org-mode text-mode haml-mode
sass-mode yaml-mode csv-mode espresso-mode haskell-mode
html-mode nxml-mode sh-mode smarty-mode clojure-mode
html-mode web-mode sh-mode smarty-mode clojure-mode
lisp-mode textile-mode markdown-mode tuareg-mode
js2-mode css-mode less-css-mode))
(add-to-list 'ac-modes mode))
Expand Down
2 changes: 1 addition & 1 deletion init-css.el
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:face mmm-code-submode-face
:front "style=\""
:back "\"")))
(dolist (mode (list 'html-mode 'nxml-mode))
(dolist (mode (list 'html-mode 'web-mode))
(mmm-add-mode-ext-class mode "\\.r?html\\(\\.erb\\)?\\'" 'html-css))))


Expand Down
2 changes: 1 addition & 1 deletion init-elpa.el
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ ARCHIVE is the string name of the package archive.")
(require-package 'bookmark+)
(require-package 'json-mode)
(require-package 'tagedit)
(require-package 'web-mode)
(require-package 'web-mode '(7 0 21) nil)
(require-package 'sr-speedbar)
(require-package 'requirejs-mode)
(require-package 'smartparens)
Expand Down
2 changes: 0 additions & 2 deletions init-evil.el
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
(interactive)
(if (or (eq major-mode 'html-mode)
(eq major-mode 'xml-mode)
(eq major-mode 'nxml-mode)
(eq major-mode 'web-mode)
)
(progn
Expand Down Expand Up @@ -193,7 +192,6 @@ to replace the symbol under cursor"
;; move cursor
(if (or (eq major-mode 'html-mode)
(eq major-mode 'xml-mode)
(eq major-mode 'nxml-mode)
(eq major-mode 'web-mode)
)
(my-sp-select-next-thing NUM)
Expand Down
5 changes: 4 additions & 1 deletion init-flymake.el
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(setq flymake-gui-warnings-enabled nil)


;; Stop flymake from breaking when ruby-mode is invoked by mmm-mode,
;; at which point buffer-file-name is nil
(eval-after-load 'flymake
Expand All @@ -9,6 +10,8 @@
(defun flymake-can-syntax-check-file (file-name)
"Determine whether we can syntax check FILE-NAME.
Return nil if we cannot, non-nil if we can."
(if (and file-name (flymake-get-init-function file-name)) t nil))))
(if (and file-name (flymake-get-init-function file-name)) t nil))
))


(provide 'init-flymake)
5 changes: 1 addition & 4 deletions init-flyspell.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
css-mode-hook
haskell-mode-hook
caml-mode-hook
nxml-mode-hook
web-mode-hook
crontab-mode-hook
perl-mode-hook
tcl-mode-hook
js2-mode-hook))
(add-hook hook 'flyspell-prog-mode))
(add-hook 'nxml-mode-hook
(lambda ()
(add-to-list 'flyspell-prog-text-faces 'nxml-text-face)))

;; you can also use "M-x ispell-word" or hotkey "M-$". It pop up a multiple choice
;; @see http://frequal.com/Perspectives/EmacsTip03-FlyspellAutoCorrectWord.html
Expand Down
2 changes: 1 addition & 1 deletion init-ibuffer.el
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(mode . c-mode)
(mode . java-mode)
(mode . idl-mode)
(mode . nxml-mode)
(mode . web-mode)
(mode . lisp-mode)
(mode . js2-mode)
(mode . c++-mode)
Expand Down
59 changes: 0 additions & 59 deletions init-nxml.el

This file was deleted.

2 changes: 0 additions & 2 deletions init-osx-keys.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
;; Woohoo!!
(global-set-key (kbd "M-`") 'ns-next-frame)
(global-set-key (kbd "M-h") 'ns-do-hide-emacs)
(eval-after-load 'nxml-mode
'(define-key nxml-mode-map (kbd "M-h") nil))
(global-set-key (kbd "M-ˍ") 'ns-do-hide-others) ;; what describe-key reports
(global-set-key (kbd "M-c") 'ns-copy-including-secondary)
(global-set-key (kbd "M-v") 'ns-paste-secondary)))
Expand Down
4 changes: 2 additions & 2 deletions init-ruby-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
;;----------------------------------------------------------------------------
(defun sanityinc/ensure-mmm-erb-loaded ()
(require 'mmm-erb))
(dolist (hook (list 'html-mode-hook 'nxml-mode-hook 'yaml-mode-hook))
(dolist (hook (list 'html-mode-hook 'web-mode-hook 'yaml-mode-hook))
(add-hook hook 'sanityinc/ensure-mmm-erb-loaded))

(dolist (mode (list 'html-mode 'html-erb-mode 'nxml-mode))
(dolist (mode (list 'html-mode 'html-erb-mode 'web-mode))
(mmm-add-mode-ext-class mode "\\.r?html\\(\\.erb\\)?\\'" 'html-js)
(mmm-add-mode-ext-class mode "\\.r?html\\(\\.erb\\)?\\'" 'html-css)
(mmm-add-mode-ext-class mode "\\.erb\\'" 'erb))
Expand Down
6 changes: 3 additions & 3 deletions init-smartparens.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(smartparens-global-mode t)

(setq sp-navigate-consider-sgml-tags '(html-mode
nxml-mode
web-mode
xml-mode))
;; highlights matching pairs
(show-smartparens-global-mode t)
Expand All @@ -20,7 +20,7 @@
(sp-local-tag "i" "1d5f8e69396c521f645375107197ea4dfbc7b792quot;<" "1d5f8e69396c521f645375107197ea4dfbc7b792quot;>"))

;;; html-mode
(sp-with-modes '(html-mode sgml-mode nxml-mode)
(sp-with-modes '(html-mode sgml-mode web-mode )
(sp-local-pair "<" ">"))

;;; lisp modes
Expand Down Expand Up @@ -115,4 +115,4 @@
)
)

(provide 'init-smartparens)
(provide 'init-smartparens)
24 changes: 24 additions & 0 deletions init-web-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,29 @@
(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.ftl\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))

(defun flymake-html-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "tidy" (list local-file))))

(defun flymake-html-load ()
(interactive)
(when (and (not (null buffer-file-name)) (file-writable-p buffer-file-name))
(set (make-local-variable 'flymake-allowed-file-name-masks)
'(("\\.html\\|\\.ctp\\|\\.ftl\\|\\.jsp\\|\\.php\\|\\.erb\\|\\.rhtml" flymake-html-init))
)
(set (make-local-variable 'flymake-err-line-patterns)
'(("line \\([0-9]+\\) column \\([0-9]+\\) - \\(Warning\\|Error\\): \\(.*\\)" nil 1 2 4))
)
(flymake-mode t)))

(add-hook 'web-mode-hook
(lambda ()
(flymake-html-load)
))
(provide 'init-web-mode)
2 changes: 1 addition & 1 deletion init-yari.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(defun ri-bind-key ()
(local-set-key "\C-c;y" 'yari-anything))
(add-hook 'ruby-mode-hook 'ri-bind-key)
(add-hook 'nxml-mode-hook 'ri-bind-key)
(add-hook 'web-mode-hook 'ri-bind-key)
(add-hook 'html-mode-hook 'ri-bind-key)
(add-hook 'inf-ruby-mode-hook 'ri-bind-key)

Expand Down
2 changes: 1 addition & 1 deletion init-zencoding-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; @see https://github.com/smihica/emmet for new tutorial
;; C-j or C-return to expand the line
(add-hook 'sgml-mode-hook 'emmet-mode)
(add-hook 'nxml-mode-hook 'emmet-mode)
(add-hook 'web-mode-hook 'emmet-mode)
(add-hook 'css-mode-hook 'emmet-mode)

(provide 'init-zencoding-mode)
4 changes: 1 addition & 3 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
(require 'init-php)
(require 'init-org)
(require 'init-org-mime)
(require 'init-nxml)
(require 'init-css)
(require 'init-haml)
(require 'init-python-mode)
Expand Down Expand Up @@ -145,8 +144,7 @@
(require 'init-workgroups)
(require 'init-move-window-buffer)
(require 'init-term-mode)
;; I'm fine with nxml-mode, so web-mode is not used
;;(require 'init-web-mode)
(require 'init-web-mode)
(require 'init-sr-speedbar)
(require 'init-smartparens)
;; Choose either auto-complete or company-mode by commenting one of below two lines!
Expand Down
Loading

0 comments on commit 376d1d9

Please sign in to comment.