Editor Integration

Buf produces file:line:column:message error output by default for build, lint, and breaking change errors. It can also output errors in JSON. As such, it is easy to write editor integrations that provide real-time feedback to developers.

Right now, we only provide Vim integration, however we expect to cover Emacs, VS Code, and potentially Intellij in the near future. Please contact us if you are interested in any of these.


Vim integration for linting is available using the ALE lint engine via the vim-buf plugin.

To use Vim integration, Buf must be installed. Using vim-plug, add the following to your .vimrc:

Plug 'dense-analysis/ale'
Plug 'bufbuild/vim-buf'
let g:ale_linters = {
\ 'proto': ['buf-check-lint',],
let g:ale_lint_on_text_changed = 'never'
let g:ale_linters_explicit = 1

This will result in individual files being linted on save via buf check lint --path. Note that some lint checkers are dependent on checking multiple files at once, for example the lint checkers in the PACKAGE_AFFINITY category, so we still recommend your CI setup runs buf check lint.

Buf will be executed in your current directory, which results in your configuration being read from your current directory.