A small, dependency-free Neovim task popup with one task list per git repository.
tasks.nvim stores tasks outside your repositories by default, under
stdpath("data")/tasks.nvim/tasks.json, keyed by the absolute git root. Opening
the popup in one repository will not show tasks from another repository.
Use any Neovim plugin manager. With lazy.nvim, this spec lazy-loads on the
commands or keymap:
return {
"your-name/tasks.nvim",
main = "tasks",
cmd = { "TasksOpen", "TasksToggle", "TasksAdd" },
keys = {
{
"<leader>tt",
function()
require("tasks").toggle()
end,
desc = "Toggle repo tasks",
},
},
opts = {},
}For local development:
{
dir = "<path to tasks.nvim>",
name = "tasks.nvim",
main = "tasks",
cmd = { "TasksOpen", "TasksToggle", "TasksAdd" },
keys = {
{
"<leader>tt",
function()
require("tasks").toggle()
end,
desc = "Toggle repo tasks",
},
},
opts = {},
}The plugin's own keymap option is still available, but with lazy.nvim the
keys field is preferred because it can lazy-load the plugin.
If you prefer a Harpoon-style config function with direct mappings:
config = function()
local tasks = require("tasks")
tasks.setup()
vim.keymap.set("n", "<leader>tt", tasks.toggle, { desc = "Toggle repo tasks" })
vim.keymap.set("n", "<leader>to", tasks.open, { desc = "Open repo tasks" })
vim.keymap.set("n", "<leader>ta", function()
tasks.add()
end, { desc = "Add repo task" })
endCommands:
:TasksOpen:TasksToggle:TasksAdd [task text]
Popup keys:
aadd a taskeedit the task under the cursorxor<Space>cross off or reopen a taskddelete the task under the cursorqor<Esc>close the popup
require("tasks").setup({
keymap = nil,
data_path = vim.fs.joinpath(vim.fn.stdpath("data"), "tasks.nvim", "tasks.json"),
popup = {
width = 68,
height = 16,
border = "rounded",
title = "Tasks",
},
mappings = {
close = { "q", "<Esc>" },
add = "a",
edit = "e",
toggle = { "x", "<Space>" },
delete = "d",
},
})The plugin requires Neovim 0.10 or newer.