Ⅰ. 插件描述
Eco (embedded coffee-script) support for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'andrewradev/vim-eco'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'andrewradev/vim-eco'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'andrewradev/vim-eco'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/andrewradev/vim-eco
Ⅳ. 文档说明
This project adds [eco] support to the vim editor. Most of the code is
originally from Mick Koch's [vim-coffee-script].
Included features:
- eco filetype detection
- automatic indenting
- syntax highlighting
- surround.vim support (see [ftplugin/eco.vim] for details)
=text object for code blocks (see [ftplugin/eco.vim] for details)
Some of the code here depends on [vim-coffee-script], so it's required that you
install that before installing this plugin. The master branch should always be
compatible with [vim-coffee-script]'s master branch, so if you have any
problems, please ensure you've updated both plugins to their latest version.
Collaborators are welcome. If you feel you're fairly comfortable with the code
and use eco on a regular basis, please consider becoming a maintainer of a part
of the project -- just open up a github issue requesting collaborator access.
Naturally, pull request with fixes or interesting new features are always
welcome.
Install from a Zipball
This is the quickest way to get things running.
Packages (don't use the Download buttons.)
- Extract the archive into
~/.vim/:unzip -od ~/.vim vim-eco-HASH.zip
These steps are also used to update the plugin.
Install with Pathogen
Since this plugin has rolling versions based on git commits, using pathogen and
git is the preferred way to install. The plugin ends up contained in its own
directory and updates are just a git pull away.
- Install tpope's [pathogen] into
~/.vim/autoload/and add this line to your
vimrc:
call pathogen#infect()
To get the all the features of this plugin, make sure you also have a
`filetype plugin indent on` line in there.
Create and change into
~/.vim/bundle/:$ mkdir ~/.vim/bundle $ cd ~/.vim/bundleMake a clone of the
vim-ecorepository:$ git clone https://github.com/AndrewRadev/vim-eco.git
Updating
Change into
~/.vim/bundle/vim-eco/:$ cd ~/.vim/bundle/vim-ecoPull in the latest changes:
$ git pull
Configure Syntax Highlighting
Add these lines to your vimrc to disable the relevant syntax group.
Disable reserved words error
Reserved words like function and var are highlighted as an error where
they're not allowed in CoffeeScript. This can be disabled with:
hi link coffeeReservedError NONENote: this affects coffeescript highlighting as well
Disable missing colon error
A few coffeescript control structures -- if-clauses, else-clauses and
for-cycles -- need to end with a colon, like so:
<% if foo: %>
bar
<% else: %>
baz
<% end %>If there's no colon at the end of these, they will be highlighted as errors.
This can be disabled with:
hi link ecoMissingColonError NONE