Skip to content

kborling/memmet-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

memmet-mode — Minimal Emmet Mode for Emacs

memmet-mode is a minimal, fast implementation of Emmet for HTML editing. It supports a small but powerful subset of Emmet syntax, enabling quick HTML tag generation.


Features

  • Expand basic tag names:
    div       → <div></div>
    span      → <span></span>
  • Add id and class via shorthand:
     div#main      → <div id="main"></div>
     #main         → <div id="main"></div>
     div.container → <div class="container"></div>
  • Combine id and class:
    section#hero.container → <section id="hero" class="container"></section>
  • Nesting with >:
    div>h3 → <div><h3></h3></div>
  • Multiplication (*) for repeated elements:
    ul>li*3 → <ul><li></li><li></li><li></li></ul>

Usage

Install the package manually and load it in your emacs init file.

Enable memmet-mode in HTML buffers:

(use-package memmet-mode
:load-path "/path/to/memmet"
:hook (html-mode . memmet-mode))

Use the expansion command:

M-x memmet-expand

Or bind it to a key, e.g.:

(define-key memmet-mode-map (kbd "C-c m e") #'memmet-expand)

Type a minimal Emmet expression like div#app>ul>li*3, place point at the end, and run memmet-expand.

About

Minimal emmet mode for emacs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published