Skip to content
Basic Bazel support for Emacs
Emacs Lisp
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


Basic Bazel support for Emacs

For now this mode gives you python syntax highlighting for WORKSPACE, BUILD.bazel and .bzl files. Formatting is supported by running buildifier.

Installing buildifier

Buildifier needs Go to compile and install. Follow the directions in [1] or install by running the following command.

go get -u


Formatting Bazel files manually

C-c C-f runs bazel-format on the current buffer.

Formatting Bazel files automatically before saving

Add the following to your Emacs config.

(add-hook 'bazel-mode-hook (lambda () (add-hook 'before-save-hook #'bazel-format nil t)))
You can’t perform that action at this time.