Skip to content

marcuscaisey/please.nvim

Repository files navigation

please.nvim CI

please.nvim is a Neovim plugin for the Please build system.

See https://please.build or https://github.com/thought-machine/please for more information about Please itself.

Bug reports and feature requests are welcome. Please open an issue if you find something that does not work as expected, or if there is a feature you would like to see added.

Features

Build a target with :Please build

In Source File

In BUILD File

Run a target with :Please run

In Source File

In BUILD File

Test a target with :Please test

In Source File

Run Test Under Cursor

In BUILD File

Display test coverage for a target with :Please cover

In Source File

Run Test Under Cursor

In BUILD File

Debug a target with :Please debug

In Source File

Run Test Under Cursor

In BUILD File

Run an arbitrary plz command in a popup with :Please command.
Display history of previous commands and run any of them again with :Please history.
Set the profile to use with :Please set_profile.
Jump from a source file to its target's definition with :Please jump_to_target.
Look up a target by its build label with :Please look_up_target.

Provide Label

Use Label Under Cursor

Yank a target's build label with :Please yank.

In Source File

In BUILD File

  • please configured as the 'filetype' for build files: *.build, *.build_defs, and the build file names set as parse.buildfilename in .plzconfig (defaults to BUILD and BUILD.plz). is configured as parse.buildfilename (defaults to BUILD and BUILD.plz).
  • ini configured as the 'filetype' for .plzconfig files to enable better syntax highlighting.
  • Python tree-sitter parser configured to be used for please files to enable better syntax highlighting and use of all tree-sitter features in BUILD files.
  • please LSP client configured to use plz tool lps for please files.
  • Language servers gopls, golangci-lint-langserver, basedpyright, and pyright configured for use in a Please repository.
  • Runs puku fmt when a Go file is saved.

Requirements

please.nvim requires:

please.nvim supports the latest two Neovim minor versions. CI tests against the minimum supported version and the latest patch of each supported minor.

Additional dependencies are required for some features:

  • tree-sitter-go enables :Please test under_cursor, :Please cover under_cursor, and :Please debug under_cursor in Go files.
  • tree-sitter-python enables:
    • :Please test under_cursor, :Please cover under_cursor, and :Please debug under_cursor in Python files.
    • :Please jump_to_target and :Please look_up_target.
    • :Please build, :Please run, :Please test, :Please debug, and :Please yank in BUILD files.
  • nvim-dap enables :Please debug.

Execute :checkhealth please to verify that the required dependencies are available and to see whether any feature-specific dependencies are missing.

Getting started

Quickstart

Note

These steps require Neovim >= 0.12 to use vim.pack.

  1. Open a test file in a Please repository.
  2. Execute :lua vim.pack.add({ 'https://github.com/marcuscaisey/please.nvim' }, { confirm = false }) to install please.nvim.
  3. Execute :Please test to test the target corresponding to the test file in a popup.
  4. Execute :lua vim.pack.del({ 'please.nvim' }, { force = true }) to uninstall please.nvim.

Installation

Install using your favourite plugin manager. See below for snippets for some popular ones.

Snippets

Note

Requires Neovim >= 0.12.

vim.pack.add({
    {
        src = 'https://github.com/marcuscaisey/please.nvim',
        version = vim.version.range('1.*'), -- Use for stability; omit to use master branch for the latest features
    },
})
{
    'marcuscaisey/please.nvim',
    version = '1.*', -- Use for stability; omit to use master branch for the latest features
}

Recommended additional plugins

  • nvim-treesitter - Tree-sitter configurations and abstraction layer for Neovim. This enables you to install tree-sitter parsers.
  • fzf-lua - Highly extendable fuzzy finder. This provides a good vim.ui.select implementation.
  • nvim-dap-ui - UI for nvim-dap.

Documentation

See doc/please.txt or execute :help please.nvim.