Skip to content

noscript/bazel.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bazel.vim - Bazel build system integration for Vim

  • Tab autocompletion for targets
  • goto-definition for BUILD files
  • listing references

and more.

Comparison

Feature bazel.vim official vim-bazel
Zero dependency ✗(requires Bash completion + vim-maktaba)
Tab completion
Integration with Vim terminal ✓(does not reuse terminal window)
Build results in QuickFix
Go to BUILD file
Go to label/target definition
List references

Default mappings

  • gb - Go to BUILD file corresponding to the current buffer.
  • gd - Go to label definition under cursor (for BUILD and .bzl files).
  • gr - List references for label under cursor (for BUILD and .bzl files).
  • <leader>p - Print label that corresponds to current buffer.
  • b<C-G> - Print current buffer path relative to workspace.

Commands

  • Bazel {args} - Run Bazel command and open QuickFix when done.

Example:

:Bazel build //main:hello-world
  • BazelDefinition {target} - Jump to target definition.

Example:

:BazelDefinition //main:hello-world
  • BazelReferences {target} - List target references.

Example:

:BazelReferences //lib:hello-time