Skip to content

A Neovim plugin for interacting with Please repositories

Notifications You must be signed in to change notification settings

marcuscaisey/please.nvim

Repository files navigation

please.nvim CI

please.nvim is a plugin which allows you interact with your Please repository from the comfort of Neovim. The aim is to remove the need to switch from your editor to the shell when performing routine actions.

Features

  • Build, run, test, and debug a target with please.build(), please.run(), please.test(), and please.debug().
  • 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 build target definition with please.jump_to_target().
  • Yank a target's label with please.yank().
  • please configured as the filetype for BUILD, BUILD.plz, 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

Demo

Screen.Recording.2022-12-03.at.18.22.18.mov

Shown above:

  1. Testing the target //gopkg:test from gopkg/gopkg_test.go with <space>pt (require('please').test())
  2. Jumping to the defintion of the target //gopkg:test from gopkg/gopkg_test.go with <space>pj (require('please').jump_to_target())
  3. Testing the target //gopkg:test again, this time from the BUILD file (require('please').test() again)

Documentation

Detailed documentation can be in doc/please.txt or by running :help please.nvim.

Getting started

Installation

ℹ️ Neovim >= 0.10 is required to use please.nvim

Using packer.nvim

use({ 'marcuscaisey/please.nvim' })

Using vim-plug

Plug 'marcuscaisey/please.nvim'

Using dein

call dein#add('marcuscaisey/please.nvim')

Recommended additional plugins

  • nvim-treesitter - Tree-sitter configurations and abstraction layer for Neovim.
  • telescope.nvim - Highly extendable fuzzy finder.
  • dressing.nvim - Pairs with telescope.nvim to provide a nice popup for inputs (vim.ui.input) and selections (vim.ui.select).
  • nvim-dap - Debug Adapter Protocol client implementation for Neovim. This is required to use please.debug().
  • nvim-dap-ui - UI for nvim-dap.

nvim-treesitter configuration

please.nvim configures the Python tree-sitter parser to be used for please files. It doesn't, however, configure anything else to do with nvim-treesitter, so it's recommended to at least enable syntax highlighting like so:

require('nvim-treesitter.configs').setup({
  highlight = {
    enable = true,
  },
})

For more information on configuring nvim-treesitter, see here.