• Stars
    star
    6,288
  • Rank 6,353 (Top 0.2 %)
  • Language
    Vim Script
  • License
    MIT License
  • Created almost 15 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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:

More Repositories

1

go-sqlite3

sqlite3 driver for go using database/sql
C
7,722
star
2

goreman

foreman clone written in go language
Go
2,330
star
3

go-gtk

Go binding for GTK
Go
2,108
star
4

vim-gist

Vim plugin for Gist
Vim Script
1,688
star
5

gom

Go Manager - bundle for go
Go
1,389
star
6

anko

Scriptable interpreter written in golang
Go
1,364
star
7

go-generics-example

Example code for Go generics
Go
1,324
star
8

vim-lsp-settings

Auto configurations for Language Server for vim-lsp
Vim Script
1,110
star
9

memo

📓 Memo Life For You
Go
924
star
10

efm-langserver

General purpose Language Server
Go
880
star
11

goveralls

Go
789
star
12

go-isatty

Go
739
star
13

sudo

sudo for windows
Go
732
star
14

go-colorable

Go
713
star
15

webapi-vim

vim interface to Web API
Vim Script
680
star
16

longcat

Looooooooooooooooooooooooooooooooooooooooooooooong cat
Go
645
star
17

go-oci8

Oracle driver for Go using database/sql
Go
618
star
18

docx2md

Convert Microsoft Word Document to Markdown
Go
575
star
19

awesome-twitter-communities

Awesome Twitter Communities for Engineers
561
star
20

go-mastodon

mastodon client for golang
Go
553
star
21

go-runewidth

wcwidth for golang
Go
544
star
22

go-shellwords

Parse line as shell words
Go
491
star
23

vim-sonictemplate

Easy and high speed coding method
Vim Script
329
star
24

go-webkit

webkit widget for go-gtk
Go
291
star
25

twty

command-line twitter client written in golang
Go
280
star
26

gopher

Windows Desktop Mascot Applicaiton "Gopher"
Go
279
star
27

go-tflite

Go binding for TensorFlow Lite
Jupyter Notebook
270
star
28

go-v8

Go binding for v8
Go
264
star
29

calendar-vim

calendar vimscript
Vim Script
253
star
30

flappyvird-vim

Vim Script
235
star
31

growl-for-linux

Growl Implementation For Linux #growl4linux
C
207
star
32

go-zglob

Go
195
star
33

go-redmine

Go
186
star
34

ft

File Transferer
Go
185
star
35

go-tty

Go
184
star
36

goemon

äș”ćłèĄ›é–€
Go
179
star
37

gof

Go
177
star
38

qq

Go
166
star
39

vim-maketable

Vim Script
150
star
40

vim-goimports

Vim plugin for Minimalist Gopher
Vim Script
149
star
41

go-pipeline

Go
147
star
42

etcdenv

Go
142
star
43

jvgrep

grep for japanese vimmer
Go
140
star
44

go-sixel

DRCS/Sixel Encoder/Decoder
Go
137
star
45

go-vue-example

Example App using Go, Vue.js, Element, Axios
Go
135
star
46

tailscale-systray

Linux port of tailscale system tray menu.
Go
134
star
47

go-adodb

Microsoft ActiveX Object DataBase driver for go that using exp/sql
Go
133
star
48

vim-particle

This plugin works on Windows
C
129
star
49

todo

A simple command-line todo list written in Go.
Go
129
star
50

jedie

Static site generator written in golang
Go
128
star
51

clask

Web micro-framework like flask in C++.
C++
124
star
52

golisp

Lisp Interpreter
Go
123
star
53

go-pointer

Go
118
star
54

godown

Convert HTML into Markdown
Go
113
star
55

go-gimei

Go
113
star
56

vim-trex

Running T-Rex with Vim
JavaScript
111
star
57

golang-wasm-example

Example app using Go's wasm support.
JavaScript
111
star
58

livestyle-vim

Emmet LiveStyle for Vim
Vim Script
110
star
59

go-pubsub

Go
107
star
60

go-scan

Go
103
star
61

go-slim

Slim Template Engine for golang
Go
103
star
62

vim-notification

Message notification system for Vim8
Vim Script
103
star
63

gowasmer

WebAssembly runtime for wasmer-go
Go
102
star
64

bsky

A cli application for bluesky social
Go
101
star
65

dotfiles

100
star
66

vim-starwars

Playing StarWars on Vim
Vim Script
97
star
67

vim-brain

Neural Networks written in Vim script
Vim Script
96
star
68

go-nulltype

Null friendly types
Go
96
star
69

go-jsonpointer

Go
95
star
70

files

Fast file find
Go
92
star
71

mkup

Portable Markdown Previewer
JavaScript
92
star
72

go-uv

Go binding for libuv
Go
92
star
73

dboxpaper

client for Dropbox Paper
Go
92
star
74

mruby-uv

interface to libuv for mruby(experimental)
C
91
star
75

davfs

Go
90
star
76

tinytinyhttpd

tiny tiny httpd
C++
88
star
77

echo-scaffold

Echo scaffold is CLI to generate scaffolds for the echo framework.
Go
87
star
78

vim-chatgpt

Vim Script
85
star
79

streeem

ごめんăȘさいごめんăȘさい
Go
85
star
80

go-mruby

go-mruby make interface to embed mruby into go.
Go
83
star
81

algia

A cli application for nostr
Go
80
star
82

http-server

C
76
star
83

go-ieproxy

Go
76
star
84

cho

Go
76
star
85

vim-sqlfmt

Vim Script
74
star
86

vim-molder

Vim Script
71
star
87

vim-treesitter

Go
70
star
88

vimtweak

VimTweak : The tweaking dll for GVim.exe.
C
69
star
89

gomate

Go
68
star
90

awesome-sonomasakada

68
star
91

ansicolor-w32.c

C
67
star
92

gh-ost

gh extension to meet ghost.
Shell
66
star
93

http-gonsole

Speak HTTP like a local. (the simple, intuitive HTTP console, golang version)
Go
65
star
94

vim-fz

Ultra Fast Fuzzy Finder for Vim8
Vim Script
65
star
95

vdbi-vim

Database client for Vim
Vim Script
64
star
96

chatgpt

Go
63
star
97

xgopher

Linux port of https://github.com/mattn/gopher
C
61
star
98

gntp-send

command line program that send to growl using GNTP protocol.
C
57
star
99

vim-usa_president_2016

Vim Script
55
star
100

go-uwsgi

uwsgi implement for go
Go
54
star