A simple plugin for taskfiles
- Run a specific task directly within Neovim
- Browse available tasks with a floating window
- Preview each task’s command before execution
- Run tasks in a floating terminal
- Automatically scroll to bottom of output (optional)
- Rerun last task via command or key-map
- Flexible layout with width_ratio or auto-sizing to fit task names and descriptions neatly
- task CLI installed and in your
$PATH
- Neovim 0.8 or higher (0.9+ recommended)
{
"dasvh/taskfile.nvim",
config = function()
require("taskfile").setup()
end,
}
You can pass options to the setup()
function to customise behaviour.
All fields are optional and shown below with their default values:
require('taskfile').setup({
windows = {
output = { -- Task output window
width = 0.8, -- Width of the window (percentage of editor width)
height = 0.8, -- Height of window (percentage of editor height)
border = "rounded" -- Border style: 'single', 'double', 'rounded', etc.
},
list = { -- Task list and preview window
width = 0.6,
height = 0.4,
border = "rounded"
width_ratio = 0, -- Ratio (0–1) of list vs preview width.
-- If set, determines how much space is given to the list.
-- If unset or 0, the list width is calculated to fit
-- longest task name and description without wrapping.
},
},
scroll = {
auto = true, -- Auto-scroll output to bottom when new lines are printed
},
keymaps = {
rerun = "<leader>tr" -- Key-map to rerun the last executed task
},
})
This plugin reads your Taskfile and displays available tasks.
:Task <task_name>
: Run a specific task by name:Task
: Show a floating task selector with preview:TaskRerun
: Rerun the last executed task
You can also bind a key to rerun using the keymaps.rerun
config.