Open-source project
mattn/emmet-vim avatar
mattn/emmet-vim

emmet-vim: Expanding HTML and CSS Abbreviations Inside Vim

emmet for vim: http://emmet.io/

6,466 stars414 forksVim ScriptMIT

At a glance

What is it?
emmet-vim is a Vim plugin that brings the Emmet abbreviation expansion system to Vim and Neovim, triggered by Ctrl+y followed by a comma. It is a mature, narrowly scoped tool for front-end developers who write HTML and CSS inside Vim and want the same shorthand expansion that editors like VS Code provide natively.
Who is it for?
emmet-vim is appropriate for any developer who writes HTML or CSS in Vim and wants Emmet shorthand without switching editors. It is not the right fit for Neovim users who want LSP-based completion integration, since emmet-vim predates the Neovim LSP ecosystem and does not expose a language server interface.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Activity is slowing. The repository last received commits 6 months ago.
What is it written in?
Mainly Vim Script, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What emmet-vim Adds to Vim's HTML and CSS Editing

Emmet is a system that expands short text abbreviations into full HTML or CSS code. The abbreviation html:5 produces a complete HTML5 document skeleton. A selector like ul>li*3 expands to a list with three items. These expansions are available natively in VS Code and a number of other editors, but Vim's built-in completion does not include them.

emmet-vim fills that gap. It is a Vim plugin written in Vim Script that ports Emmet's abbreviation expansion to Vim, covering both HTML and CSS modes. The plugin's home page is mattn.github.io/emmet-vim and the repository is on GitHub under mattn/emmet-vim.

The target user is a front-end developer who writes markup and styles inside Vim and does not want to leave the editor to produce boilerplate HTML. If you use a different editor or an LSP-based setup in Neovim, emmet-vim may not be what you are looking for.

How the Ctrl+y Comma Trigger Works

The default trigger sequence in emmet-vim is Ctrl+y followed by a comma. You type an abbreviation, then press Ctrl+y and comma (two keystrokes), and the plugin expands the abbreviation in place. The README shows this with the html:5 example: after typing html:5 and pressing Ctrl+y comma, the editor replaces the abbreviation with a complete HTML5 document including doctype, html, head, meta charset, title, and body tags.

The Ctrl+y part is the leader key. It can be remapped using the g:user_emmet_leader_key variable. The trailing comma is always required, so changing the leader to Ctrl+z makes the full trigger Ctrl+z comma rather than Ctrl+z alone.

This two-keystroke design is deliberate: it avoids conflicts with other Vim bindings that use Ctrl+y for scrolling. The trade-off is that the trigger is slightly different from what users expect if they are coming from VS Code, where Tab alone expands Emmet abbreviations.

Installing emmet-vim with vim-plug, Pathogen, or from Source

The README documents several installation paths. With vim-plug, add one line to your vimrc and run PlugInstall:

vim
Plug 'mattn/emmet-vim'

With pathogen.vim, clone the repository directly into your bundle directory:

sh
git clone https://github.com/mattn/emmet-vim.git ~/.vim/bundle/emmet-vim

For a manual installation without a plugin manager, copy the plugin and autoload files from the cloned repository into the corresponding directories in ~/.vim. The README also documents a zip file download from vim.org for environments without git.

After installation, the plugin is active in all modes by default. The README notes that you can restrict it to normal mode only using g:user_emmet_mode='n', or explicitly enable all modes with g:user_emmet_mode='a'.

Configuring emmet-vim: File Types, Leader Keys, and Custom Snippets

By default, emmet-vim installs globally and activates for all file types. For most HTML and CSS work this is fine, but the README provides a two-line vimrc configuration to restrict activation to specific file types:

vim
let g:user_emmet_install_global = 0
autocmd FileType html,css EmmetInstall

Setting g:user_emmet_install_global to 0 prevents global installation, and the autocmd then calls EmmetInstall only for the html and css file types.

To change the leader key away from Ctrl+y, set g:user_emmet_leader_key. For example, changing it to Ctrl+z:

vim
let g:user_emmet_leader_key='<C-Z>'

Custom snippet support requires the separate webapi-vim plugin. Once installed, set g:user_emmet_settings to a decoded JSON object from a local snippets_custom.json file. The README provides the vimrc line for this and points to Emmet's own documentation for the snippet file format. The same mechanism supports overriding the default html:5 expansion to include a viewport meta tag, with a full example in the README.

Known Limitations and the timeoutlen Problem

The README's FAQ section names one common failure case directly: pressing Ctrl+y comma does nothing when timeoutlen is set to 0 in vimrc. A timeoutlen of 0 prevents Vim from waiting for multi-key sequences, which breaks the leader key mechanism that emmet-vim relies on. This affects most Vim plugins that use key mappings with multiple characters, not just emmet-vim.

Beyond that, the plugin is scoped narrowly to Emmet abbreviation expansion. It does not provide language server integration, completion menu items, or code actions in the Neovim LSP sense. Users who want LSP-based Emmet in Neovim are better served by emmet-language-server or emmet-ls, which expose Emmet functionality over the Language Server Protocol and integrate with nvim-lspconfig.

Custom snippet support has an external dependency on webapi-vim. If you want to extend the default snippets, that second plugin must also be installed and configured. The README documents this requirement, but it is easy to miss if you are reading the configuration section in isolation.

emmet-vim vs emmet-language-server: Different Models of Integration

emmet-vim is a self-contained Vim Script plugin. It does not communicate with any external process and has no protocol layer between the plugin and the editor. Expansion happens synchronously, in-process, using Vim Script logic.

emmet-language-server (also called emmet-ls) is a Language Server Protocol implementation of Emmet. It runs as a separate process and communicates with editors through the LSP protocol, which Neovim supports natively through its built-in LSP client. This makes emmet-ls available to any LSP-capable editor, not just Vim.

The practical difference is integration depth: emmet-ls can appear as a completion item in a standard Neovim completion menu alongside other LSP completions, while emmet-vim uses its own trigger key sequence outside the completion menu. For Neovim users who have already invested in an LSP configuration, emmet-ls fits more naturally into the existing setup. For Vim users who prefer a standalone plugin with no external process, emmet-vim is the simpler path.

Maintenance Status and MIT License

The last push to the mattn/emmet-vim repository was on 2026-03-24. The repository is not archived. The plugin has been in development for over a decade, and the repository includes a test suite run via the vim-themis testing framework, which can be invoked with make test.

The plugin is MIT-licensed, permitting free use, modification, and redistribution. There are no restrictions on including it in a Vim configuration distributed to a team or bundled with a development environment.

The plugin's age is worth noting when evaluating it for Neovim. It predates the Neovim LSP ecosystem by years, and the active development community for Emmet in Neovim has shifted toward LSP-based solutions. emmet-vim continues to function correctly in Vim and provides the same expansion capabilities it always has.

Editorial conclusion

emmet-vim is appropriate for any developer who writes HTML or CSS in Vim and wants Emmet shorthand without switching editors. It is not the right fit for Neovim users who want LSP-based completion integration, since emmet-vim predates the Neovim LSP ecosystem and does not expose a language server interface. Before installing, check that timeoutlen is not set to 0 in your vimrc, as the README identifies that setting as the most common reason the Ctrl+y comma trigger fails to respond.

Frequently asked questions

What is Emmet used for?

Emmet is a system for expanding short text abbreviations into full HTML and CSS code. The emmet-vim plugin brings this capability into Vim, so that typing an abbreviation like html:5 and pressing the trigger sequence produces a complete HTML5 document structure. It is primarily used by front-end developers to speed up writing markup and styles.

How do I install Emmet in Vim?

The README documents installation via vim-plug (add Plug 'mattn/emmet-vim' to your vimrc and run PlugInstall), via pathogen (git clone into ~/.vim/bundle/emmet-vim), via Vundle, or by manually copying the plugin and autoload files. A zip download from vim.org is also listed for environments without git.

Why does the emmet-vim trigger key not respond?

The README FAQ identifies timeoutlen=0 in vimrc as the most common cause. A zero timeout prevents Vim from waiting for the comma after the Ctrl+y leader key, which stops the expansion from triggering. Setting timeoutlen to a non-zero value restores the behavior.

Official sources

  1. Issues
  2. License: MIT
  3. mattn/emmet-vim on GitHub
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mattn-emmet-vim.svg)](https://hysenlabs.com/projects/mattn-emmet-vim)