Ⅰ. 插件描述
Emmet for Vim, implemented with UltiSnipsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'adriaanzon/vim-emmet-ultisnips'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'adriaanzon/vim-emmet-ultisnips'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'adriaanzon/vim-emmet-ultisnips'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/adriaanzon/vim-emmet-ultisnips
Ⅳ. 文档说明
<p align="center">Emmet for Vim, implemented with UltiSnips.</p>
Installation
Requires Python 3.4 or higher (:python3 print(sys.version)) and
UltiSnips.
Install via e.g. vim-plug:
Plug 'adriaanzon/vim-emmet-ultisnips'
Plug 'SirVer/ultisnips'Configuration
The snippets are enabled by default in HTML files. To use it in Vue files for
example, put the following in your UltiSnips/vue.snippets:
extends htmlSupported syntax
| name | example |
|---|---|
| [element] | div, p |
| class | .foo, .foo.bar |
| id | #foobar |
| [child] | ul>li |
| [sibling] | div+p |
| [repeat] | div*3 |
| [text] | a{Click me} |
Alternatives
Both of these didn't work the way I wanted. I wanted it to simply work by
writing an Emmet abbreviation and pressing <Tab>, while also still having<Tab> mapped to trigger a snippet.