zencoding-vim is a vim plug-in which provides support for expanding abbreviations similar to zen-coding.
cd ~/.vim
unzip zencoding-vim.zip
To install using pathogen.vim:
cd ~/.vim/bundle
unzip /path/to/zencoding-vim.zip
To checkout the source from repository:
cd ~/.vim/bundle
git clone http://github.com/mattn/zencoding-vim.git
or:
git clone http://github.com/mattn/zencoding-vim.git
cd zencoding-vim
cp plugin/zencoding.vim ~/.vim/plugin/
cp autoload/zencoding.vim ~/.vim/autoload/
cp -a autoload/zencoding ~/.vim/autoload/
Open or create a New File:
vim index.html
Type ("_" is the cursor position):
html:5_
Then type "<c-y>," (Ctrl + y + ','), you should see:
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
_
</body>
</html>
If you don't want to enable zencoding in all modes,
you can use set these options in vimrc
:
let g:user_zen_mode='n' "only enable normal mode functions.
let g:user_zen_mode='inv' "enable all functions, which is equal to
let g:user_zen_mode='a' "enable all function in all mode.