Home

Awesome

<!-- LTeX: enabled=false -->

nvim-justice ⚖️

<!-- LTeX: enabled=true --> <!-- TODO uncomment shields when available in dotfyle.com <a href="https://dotfyle.com/plugins/chrisgrieser/nvim-justice"> <img alt="badge" src="https://dotfyle.com/plugins/chrisgrieser/nvim-justice/shield"/></a> -->

Lightweight integration of just in nvim.

<img alt="Showcase" width=50% src="https://github.com/user-attachments/assets/ae011582-61b2-41d0-b479-cc5eb9b1427d">

Table of contents

<!-- toc --> <!-- tocstop -->

Features

Installation

Requirements

-- lazy.nvim
{
	"chrisgrieser/nvim-justice",
	keys = {
		{ "<leader>j", function() require("justice").select() end, desc = "Justice" },
	},
},

-- packer
use {
	"chrisgrieser/nvim-justice",
}
vim.keymap.set("n", "<leader>j", function() require("justice").select() end, { desc = "Justice" })

Configuration

The setup call is optional.

-- default settings
require("justice").setup {
	recipes = {
		-- All strings here are checked via `string.find`, that is as lua
		-- patterns. For example, all recipes that contain `fzf` are ignored.
		-- (Note that in lua patterns, a `-` needs to escaped as `%-`.)
		ignore = { "fzf" }, -- for recipes that require user input
		streaming = { "streaming" }, -- streams output, e.g. for progress bars (requires `snacks.nvim`)
		quickfix = { "qf" }, -- runs synchronously and sends output to quickfix list
	},
	keymaps = {
		next = "<Tab>",
		prev = "<S-Tab>",
		runRecipe = "<CR>",
		closeWin = { "q", "<Esc>" },
		quickSelect = { "f", "d", "s", "a" },
		showRecipe = "<Space>",
		showVariables = "?",
	},
	window = {
		border = "rounded",
		recipeCommentMaxLen = 35,
	},
	highlights = {
		quickSelect = "Conditional",
		icons = "Function",
	},
	icons = {
		just = "󰖷",
		streaming = "ﲋ",
		quickfix = "",
		ignore = "󰈉",
	},
}

Usage

-- basic usage
require("justice").select()

-- optionally set parameters
require("justice").select({
	justfile = "path/to/custom/justfile", -- passed to `--justfile=`
})

About the author

In my day job, I am a sociologist studying the social mechanisms underlying the digital economy. For my PhD project, I investigate the governance of the app economy and how software ecosystems manage the tension between innovation and compatibility. If you are interested in this subject, feel free to get in touch.

I also occasionally blog about vim: Nano Tips for Vim

<a href='https://ko-fi.com/Y8Y86SQ91' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>