YOSHIOKA Takuma 51d68cd82c Use empty string and 0 for HTML-like type, not HTML default
In HTML-like type, `settings.html.*` is used as default setting if
`settings.(type).*` is not set.
But in HTML type and types extending HTML, `settings.html` is merged
into `settings.(type)` and no need to use `settings.html` as explicit
default.

Before this change, `param<C-y>,` expands to
`<param name="" value=""></param>` because `xml` type extends `html` by
default, and `html` has default attributes for `param` element.

With this change and `g:user_emmet_settings.xml.extends = ""`, users
can disable HTML defaults in XML files.
So then `param<C-y>,` expands to `<param></param>`.
2018-10-05 20:10:56 +09:00
2017-10-23 22:14:30 +07:00
2015-07-26 21:42:01 +09:00
2011-05-07 20:51:41 +02:00
2013-08-19 11:07:19 +09:00
2017-12-07 00:26:00 +09:00
2015-07-26 21:42:30 +09:00
2017-12-07 00:20:12 +09:00
2017-12-07 14:12:48 -06:00
2012-06-04 22:59:06 +09:00
2013-08-06 19:49:59 +09:00
2018-07-19 01:02:57 +09:00

Emmet-vim

Build Status

emmet-vim is a vim plug-in which provides support for expanding abbreviations similar to emmet.

screenshot

Installation

Download zip file:

cd ~/.vim
unzip emmet-vim.zip

To install using pathogen.vim:

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

To install using Vundle:

" add this line to your .vimrc file
Plugin 'mattn/emmet-vim'

To install using Vim-Plug:

" add this line to your .vimrc file
Plug 'mattn/emmet-vim'

To checkout the source from repository:

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

or:

git clone https://github.com/mattn/emmet-vim.git
cd emmet-vim
cp plugin/emmet.vim ~/.vim/plugin/
cp autoload/emmet.vim ~/.vim/autoload/
cp -a autoload/emmet ~/.vim/autoload/

Quick Tutorial

Open or create a New File:

vim index.html

Type ("_" is the cursor position):

html:5_

Then type <c-y>, (Ctrly,), and you should see:

<!DOCTYPE HTML>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
</head>
<body>
	_
</body>
</html>

More Tutorials

Enable in different mode

If you don't want to enable emmet in all modes, you can use set these options in vimrc:

let g:user_emmet_mode='n'    "only enable normal mode functions.
let g:user_emmet_mode='inv'  "enable all functions, which is equal to
let g:user_emmet_mode='a'    "enable all function in all mode.

Enable just for html/css

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

Redefine trigger key

To remap the default <C-Y> leader:

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

Note that the trailing , still needs to be entered, so the new keymap would be <C-Z>,.

Adding custom snippets

If you have installed the web-api for emmet-vim you can also add your own snippets using a custom snippets.json file.

Once you have installed the web-api add this line to your .vimrc:

let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/.snippets_custom.json')), "\n"))

You can change the path to your snippets_custom.json according to your preferences.

Here you can find instructions about creating your customized snippets.json file.

Project Authors

Yasuhiro Matsumoto

Emmet official site:

zen-coding official site:

emmet.vim:

development repository:

my blog posts about zencoding-vim:

Japanese blog posts about zencoding-vim:

A Chinese translation of the tutorial:

Description
Languages
Vim Script 99.7%
Lua 0.2%
Makefile 0.1%