Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indent for body and head when using html:* #186

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 34 additions & 22 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,52 @@ which provides support for expanding abbreviations similar to

[Download zip file](http://www.vim.org/scripts/script.php?script_id=2981):

cd ~/.vim
unzip emmet-vim.zip
```sh
cd ~/.vim
unzip emmet-vim.zip
```

To install using pathogen.vim:

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

To install using [Vundle](https://github.com/gmarik/vundle):

# add this line to your .vimrc file
Bundle "mattn/emmet-vim"
```vim
" add this line to your .vimrc file
Bundle "mattn/emmet-vim"
```

To checkout the source from repository:

cd ~/.vim/bundle
git clone https://github.com/mattn/emmet-vim.git
```sh
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/
```sh
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
```sh
vim index.html
```

Type ("\_" is the cursor position):
Type (`_` is the cursor position):

html:5_

Expand All @@ -52,13 +64,13 @@ Then type "\<c-y\>," (Ctrl + y + ','), you should see:
```html
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
_
</body>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
_
</body>
</html>
```

Expand Down
72 changes: 42 additions & 30 deletions autoload/emmet.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1373,51 +1373,63 @@ let s:emmet_settings = {
\ 'cc:noie': "<!--[if !IE]><!-->\n\t${child}|\n<!--<![endif]-->",
\ 'html:4t': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
\ ."<html lang=\"${lang}\">\n"
\ ."<head>\n"
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\">\n"
\ ."\t<title></title>\n"
\ ."</head>\n"
\ ."<body>\n\t${child}|\n</body>\n"
\ ."\t<head>\n"
\ ."\t\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\">\n"
\ ."\t\t<title></title>\n"
\ ."\t</head>\n"
\ ."\t<body>\n"
\ ."\t\t${child}|\n"
\ ."\t</body>\n"
\ ."</html>",
\ 'html:4s': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
\ ."<html lang=\"${lang}\">\n"
\ ."<head>\n"
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\">\n"
\ ."\t<title></title>\n"
\ ."</head>\n"
\ ."<body>\n\t${child}|\n</body>\n"
\ ."\t<head>\n"
\ ."\t\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\">\n"
\ ."\t\t<title></title>\n"
\ ."\t</head>\n"
\ ."\t<body>\n"
\ ."\t\t${child}|\n"
\ ."\t</body>\n"
\ ."</html>",
\ 'html:xt': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
\ ."<head>\n"
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
\ ."\t<title></title>\n"
\ ."</head>\n"
\ ."<body>\n\t${child}|\n</body>\n"
\ ."\t<head>\n"
\ ."\t\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
\ ."\t\t<title></title>\n"
\ ."\t</head>\n"
\ ."\t<body>\n"
\ ."\t\t${child}|\n"
\ ."\t</body>\n"
\ ."</html>",
\ 'html:xs': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
\ ."<head>\n"
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
\ ."\t<title></title>\n"
\ ."</head>\n"
\ ."<body>\n\t${child}|\n</body>\n"
\ ."\t<head>\n"
\ ."\t\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
\ ."\t\t<title></title>\n"
\ ."\t</head>\n"
\ ."\t<body>\n"
\ ."\t\t${child}|\n"
\ ."\t</body>\n"
\ ."</html>",
\ 'html:xxs': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
\ ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
\ ."<head>\n"
\ ."\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
\ ."\t<title></title>\n"
\ ."</head>\n"
\ ."<body>\n\t${child}|\n</body>\n"
\ ."\t<head>\n"
\ ."\t\t<meta http-equiv=\"Content-Type\" content=\"text/html;charset=${charset}\" />\n"
\ ."\t\t<title></title>\n"
\ ."\t</head>\n"
\ ."\t<body>\n"
\ ."\t\t${child}|\n"
\ ."\t</body>\n"
\ ."</html>",
\ 'html:5': "<!DOCTYPE html>\n"
\ ."<html lang=\"${lang}\">\n"
\ ."<head>\n"
\ ."\t<meta charset=\"${charset}\">\n"
\ ."\t<title></title>\n"
\ ."</head>\n"
\ ."<body>\n\t${child}|\n</body>\n"
\ ."\t<head>\n"
\ ."\t\t<meta charset=\"${charset}\">\n"
\ ."\t\t<title></title>\n"
\ ."\t</head>\n"
\ ."\t<body>\n"
\ ."\t\t${child}|\n"
\ ."\t</body>\n"
\ ."</html>",
\ },
\ 'default_attributes': {
Expand Down
14 changes: 7 additions & 7 deletions emmet.vim.vimup
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ detailed_description: |
+-------------------------------------
| <!DOCTYPE HTML>
| <html lang="en">
| <head>
| <title></title>
| <meta charset="UTF-8">
| </head>
| <body>
| _
| </body>
| <head>
| <title></title>
| <meta charset="UTF-8">
| </head>
| <body>
| _
| </body>
| </html>
+-------------------------------------
Type following
Expand Down