Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.

Vim Bazel

vim-bazel is a plugin for invoking bazel and interacting with bazel artifacts.

If you're looking for the Syntax and Filetype settings, that lives in vim-ft-bzl and has been integrated directly into the core-Vim syntax and filetype configuration.

Vim-bazel is currently in early development (see Development status).

For details, see the executable documentation in the vroom/ directory or the helpfiles in the doc/ directory. The helpfiles are also available via :help bazel if bazel is installed (and helptags have been generated).

DISCLAIMER: This is not an official Google product.


Use :Bazel {command} [argument...] to invoke bazel.

Usage example

:Bazel build //some/package:sometarget
INFO: Found 1 target...
Target //pkg/api:go_default_library up-to-date:
INFO: Elapsed time: 19.443s, Critical Path: 13.79s

Press ENTER or type command to continue


This example uses vim-plug, whose plugin-adding command is Plug.


" Add maktaba and bazel to the runtimepath.
" (The latter must be installed before it can be used.)
Plug 'google/vim-maktaba'
Plug 'bazelbuild/vim-bazel'

Start vim and run


Development status

Travis Build Status

Major missing features:

  • Import build errors into vim (#1, see note below)
  • Asynchronous build support (#2)

See the full list of open issues at

NOTE: If you're eager for some basic form of jump-to-error support and comfortable making some local modifications to the plugin to customize, you can try patching #11. Follow up on #1 if you're interested in getting maintainable jump-to-file functionality incorporated into the plugin.


:Bazel vs. X

Why not just use :!bazel?

The :Bazel command is currently a thin wrapper around :!bazel that supports tab completion. Upcoming improvements will offer many more features that vim's built-in shell support won't be able to offer.

Why not just use :make?

It doesn't add significant benefits for bazel usage in practice.

You can configure vim's built-in :make command to invoke "bazel build" with :set makeprg=bazel\ build. The key benefit of vim's :make command is that it can import errors from the build tool as entries in vim's quickfix list, but limitations in vim's errorformat setting make it tricky or impossible to actually cleanly parse bazel's output for a given build.

It also doesn't add any benefit related to other bazel functionality like "test" and "query" commands.

How does it compare to dispatch.vim?

dispatch.vim's :Make command has the same limitations as :make, above, just with some asynchronous execution strategies.

You can use

:Start -wait=always bazel {command}

to shell out to bazel via dispatch.vim, which works just like :!bazel (mentioned above) but with dispatch.vim's asynchronous execution. Doesn't block vim while executing long builds, but doesn't offer tab completion.

How does it compare to Neomake?

Neomake doesn't seem to add significant benefits for bazel usage in practice.

Like :make, it doesn't support bazel's specific functionality very well and the quickfix support is tricky or impossible to configure properly.


Vim support for Bazel




Code of conduct





No releases published


No packages published