An open API service indexing awesome lists of open source software.

https://github.com/dasvh/taskfile.nvim

Run Taskfile tasks inside Neovim with floating terminals, previews, and simple keymaps.
https://github.com/dasvh/taskfile.nvim

lua nvim nvim-plugin task taskfile

Last synced: 9 months ago
JSON representation

Run Taskfile tasks inside Neovim with floating terminals, previews, and simple keymaps.

Awesome Lists containing this project

README

          

# taskfile.nvim

![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/dasvh/taskfile.nvim/lint-test.yml?branch=main&style=for-the-badge)
![Lua](https://img.shields.io/badge/Made%20with%20Lua-blueviolet.svg?style=for-the-badge&logo=lua)

A simple plugin for [taskfiles](https://taskfile.dev/)

## Features

- Run a specfic 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 keymap

## Requirements

- [task](https://taskfile.dev/#/installation) CLI installed and in your `$PATH`
- Neovim 0.8 or higher (0.9+ recommended)

## Setup

```lua
{
"dasvh/taskfile.nvim",
config = function()
require("taskfile").setup()
end,
}
```

### Configuration

You can pass options to the `setup()` function:

```lua
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"
},
},
scroll = {
auto = true, -- Auto-scroll output to bottom when new lines are printed
},
keymaps = {
rerun = "tr" -- Keymap to rerun the last executed task
},
})
```

All fields are optional. These are the default values:

```lua
{
windows = {
output = {
width = 0.8,
height = 0.8,
border = "rounded",
},
list = {
width = 0.6,
height = 0.4,
border = "rounded",
},
},
scroll = {
auto = true,
},
keymaps = {
rerun = "tr",
},
}
```

## Usage

This plugin reads your Taskfile and displays available tasks.

### Commands

- `:Task `: 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.