Skip to content

marcuscaisey/please.nvim

Repository files navigation

please.nvim CI

please.nvim is a plugin which enables you to interact with Please repositories from the comfort of Neovim.

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

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, BUILD.plz, *.build, and *.build_defs files.
  • 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 for :Please test under_cursor and :Please debug under_cursor in Go files
  • tree-sitter-python for :Please test under_cursor and :Please debug under_cursor in Python files, :Please jump_to_target, :Please look_up_target, and :Please build, :Please run, :Please test, :Please debug, and :Please yank in BUILD files
  • nvim-dap for :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.

About

A Neovim plugin for interacting with Please repositories

Topics

Resources

Stars

Watchers

Forks

Contributors