All Projects → mattn → Emmet Vim

mattn / Emmet Vim

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

Programming Languages

Vim Script
2826 projects
Makefile
30231 projects

Projects that are alternatives of or similar to Emmet Vim

Emmet
The essential toolkit for web-developers
Stars: ✭ 4,123 (-28.89%)
Mutual labels:  emmet
codemirror-plugin
Emmet plugin for CodeMirror web editor
Stars: ✭ 55 (-99.05%)
Mutual labels:  emmet
emmet-cli
Emmet command line interface
Stars: ✭ 27 (-99.53%)
Mutual labels:  emmet
py-emmet
Emmet abbreviation parser and expander, implemented in Python
Stars: ✭ 32 (-99.45%)
Mutual labels:  emmet
magento-advanced-code-editor
An advanced code editor that'll make it much easier to write clean markup for CMS pages, static blocks, product pages and Transactional Emails.
Stars: ✭ 19 (-99.67%)
Mutual labels:  emmet
emmet-monaco
Emmet support for monaco-editor
Stars: ✭ 19 (-99.67%)
Mutual labels:  emmet
emma.css
🍴 Emma.css { utility-classes: emmet-like; }
Stars: ✭ 53 (-99.09%)
Mutual labels:  emmet
ndslvim
专用于C-family和web前端开发的vim配置(其实通用性也还不错啦)
Stars: ✭ 14 (-99.76%)
Mutual labels:  emmet
elmmet
VS Code extension to compile emmet snippets to composition of elm functions
Stars: ✭ 17 (-99.71%)
Mutual labels:  emmet
vscode-inline-html
🎨 Adding Syntax Highlighting, Emmet, IntelliSense support for ES6 Template Strings in Visual Studio Code.
Stars: ✭ 31 (-99.47%)
Mutual labels:  emmet

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:

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

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.

Snippet to add meta tag for responsiveness

Update this in your .vimrc file.

let g:user_emmet_settings = {
\  'variables': {'lang': 'ja'},
\  'html': {
\    'default_attributes': {
\      'option': {'value': v:null},
\      'textarea': {'id': v:null, 'name': v:null, 'cols': 10, 'rows': 10},
\    },
\    'snippets': {
\      'html:5': "<!DOCTYPE html>\n"
\              ."<html lang=\"${lang}\">\n"
\              ."<head>\n"
\              ."\t<meta charset=\"${charset}\">\n"
\              ."\t<title></title>\n"
\              ."\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n"
\              ."</head>\n"
\              ."<body>\n\t${child}|\n</body>\n"
\              ."</html>",
\    },
\  },
\}

Project Authors

Yasuhiro Matsumoto

FAQ

  • Pressing ctrl+y+, doesn't work

    Probably you set timeoutlen=0. Most of Vim plugins which using key-mappings does not work with timeoutlen=0.

Links

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:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].