Help us understand the problem. What is going on with this article?

Emacs に zen-coding の後継の Emmet mode を入れる

More than 5 years have passed since last update.

便利ならしいzen-codingを入れてみたら、何でもEmmet という後継のがでてるらしいのでそっちを入れてみた。

Emmetの方はcssにも対応してるっぽい。多分他にも色々と違いがあるみたい。

インストール

cd ~/.emacs.d/site-lisp
wget https://raw.github.com/smihica/emmet-mode/master/emmet-mode.el

設定

(require 'emmet-mode)
(add-hook 'sgml-mode-hook 'emmet-mode) ;; マークアップ言語全部で使う
(add-hook 'css-mode-hook  'emmet-mode) ;; CSSにも使う
(add-hook 'emmet-mode-hook (lambda () (setq emmet-indentation 2))) ;; indent はスペース2個
(eval-after-load "emmet-mode"
  '(define-key emmet-mode-keymap (kbd "C-j") nil)) ;; C-j は newline のままにしておく
(keyboard-translate ?\C-i ?\H-i) ;;C-i と Tabの被りを回避
(define-key emmet-mode-keymap (kbd "H-i") 'emmet-expand-line) ;; C-i で展開

使い方

html ファイルで

ul#id>li.list*3

とか
css ファイルで

p1-2!+m10e+bd1#2s 

とか書くとステキに展開してくれる。

(初め動かなかったけど、scssファイルだったのが原因でした。パッチファイルを書いてマージしてもらったので今は動きます。)

他の使い方に関してはこちらを。
https://github.com/smihica/emmet-mode

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away