Ⅰ. 插件描述
Vim plugin for Bazel build script supportⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'durandj/bazel-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'durandj/bazel-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'durandj/bazel-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/durandj/bazel.vim
Ⅳ. 文档说明
# Bazel.vim
Syntax highlighting for Bazel BUILD and WORKSPACE files.
This plugin does support the official skylark extensions for the following languages:
- Closure
- Docker
- Groovy
- Java App Engine
- D
- Rust
- Jsonnet
- Scala
Installation
Pathogen
If you're using Pathogen follow the
following instructions.
cd ~/.vim/bundle && \
git clone https://github.com/durandj/bazel.vim.git
Vundle
If you're using Vundle then all you
have to do is add the following to your ~/.vimrc file.
Plugin 'durandj/bazel.vim'
Old School/Classic Plugin Management
If you're "hardcore" and you don't use any plugin manager for your Vim
environment then you will need to do the following.
- Download/Clone/Checkout the source
- Copy the contents of
bazel.vim/ftdetectto~/.vim/ftdetect - Copy the contents of
bazel.vim/ftpluginto~/.vim/ftplugin - Copy the contents of
bazel.vim/syntaxto~/.vim/syntax
Alternatives
It is worth noting that there is an alternative plugin to this one. davidzchen
wrote vim-bazel which works fine
but I decided to make my own version because I didn't like how his plugin did
not highlight the arguments to the standard build rules. While this is a small
thing I really like having a visual confirmation that I'm writing the right
thing and that there's not a typo that I'm going to find when I try to build.
The bazel.vim plugin also supports the official Skylark extensions which
the vim-bazel plugin does not at present.
TODO
- Split up support for the build rules based on if a
WORKSPACEor aBUILDfile is being edited