Skip to content

vim-scripts/Emmet.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a mirror of http://www.vim.org/scripts/script.php?script_id=2981


This is vim script support expanding abbreviation like emmet.
ref: http://emmet.io/

There is a movie using emmet.vim
ref: http://mattn.github.com/emmet-vim

Source Repository.
ref: http://github.com/mattn/emmet-vim

Type abbreviation
   +-------------------------------------
   | html:5_
   +-------------------------------------
"_" is a cursor position. and type "<c-y>," (Ctrl + y and Comma)
NOTE: Don't worry about key map. you can change it easily.
   +-------------------------------------
   | <!DOCTYPE HTML>
   | <html lang="en">
   | <head>
   |     <title></title>
   |     <meta charset="UTF-8">
   | </head>
   | <body>
   |      _
   | </body>
   | </html>
   +-------------------------------------
Type following
   +-------------------------------------
   | div#foo$*2>div.bar
   +-------------------------------------
And type "<c-y>,"
   +-------------------------------------
   |<div id="foo1">
   |    <div class="bar">_</div>
   |</div>
   |<div id="foo2">
   |    <div class="bar"></div>
   |</div>
   | _
   +-------------------------------------

Tutorial:

  http://github.com/mattn/emmet-vim/raw/master/TUTORIAL

How work this:

  http://mattn.github.com/emmet-vim

Tips:

You can customize behavior of expanding with overriding config.
This configuration will be merged at loading plugin.

  let g:user_emmet_settings = {
  \  'indentation' : '  ',
  \  'perl' : {
  \    'aliases' : {
  \      'req' : 'require '
  \    },
  \    'snippets' : {
  \      'use' : "use strict\nuse warnings\n\n",
  \      'warn' : "warn \"|\";",
  \    }
  \  }
  \}

  let g:user_emmet_expandabbr_key = '<c-e>'

  let g:use_emmet_complete_tag = 1

You can set language attribute in html using emmet_settings['lang'].