|
1 | | -# A Neovim Plugin Template |
| 1 | +# taskfile.nvim |
2 | 2 |
|
3 | | - |
| 3 | + |
4 | 4 |  |
5 | 5 |
|
6 | | -A template repository for Neovim plugins. |
| 6 | + A simple plugin for [taskfiles](https://taskfile.dev/) |
7 | 7 |
|
8 | | -## Using it |
| 8 | +## Features |
9 | 9 |
|
10 | | -Via `gh`: |
| 10 | +- Run a specfic task directly within Neovim |
| 11 | +- Browse available tasks with a floating window |
| 12 | +- Preview each task’s command before execution |
| 13 | +- Run tasks in a floating terminal |
| 14 | +- Automatically scroll to bottom of output (optional) |
| 15 | +- Rerun last task via command or keymap |
11 | 16 |
|
| 17 | +## Requirements |
| 18 | + |
| 19 | +- [task](https://taskfile.dev/#/installation) CLI installed and in your `$PATH` |
| 20 | +- Neovim 0.8 or higher (0.9+ recommended) |
| 21 | + |
| 22 | +## Setup |
| 23 | + |
| 24 | +```lua |
| 25 | +{ |
| 26 | + "dasvh/taskfile.nvim", |
| 27 | + config = function() |
| 28 | + require("taskfile").setup() |
| 29 | + end, |
| 30 | +} |
12 | 31 | ``` |
13 | | -$ gh repo create my-plugin -p ellisonleao/nvim-plugin-template |
| 32 | + |
| 33 | +### Configuration |
| 34 | + |
| 35 | +You can pass options to the `setup()` function: |
| 36 | + |
| 37 | +```lua |
| 38 | +require("taskfile").setup({ |
| 39 | + float = { |
| 40 | + width = 0.7, -- Percentage of screen width for floating windows |
| 41 | + height = 0.7, -- Percentage of screen height |
| 42 | + border = "single", -- Border style: 'single', 'rounded', etc. |
| 43 | + }, |
| 44 | + scroll = { |
| 45 | + auto = true, -- Scroll to bottom of terminal on output |
| 46 | + }, |
| 47 | + keymaps = { |
| 48 | + rerun = "<leader>rt", -- Keymap for rerunning last task |
| 49 | + }, |
| 50 | +}) |
14 | 51 | ``` |
15 | 52 |
|
16 | | -Via github web page: |
| 53 | +All fields are optional. Defaults are: |
17 | 54 |
|
18 | | -Click on `Use this template` |
| 55 | +```lua |
| 56 | +{ |
| 57 | + float = { width = 0.8, height = 0.8, border = "rounded" }, |
| 58 | + scroll = { auto = true }, |
| 59 | + keymaps = { rerun = "<leader>rt" }, |
| 60 | +} |
| 61 | +``` |
19 | 62 |
|
20 | | - |
| 63 | +## Usage |
21 | 64 |
|
22 | | -## Features and structure |
| 65 | +This plugin reads your Taskfile and displays available tasks. |
23 | 66 |
|
24 | | -- 100% Lua |
25 | | -- Github actions for: |
26 | | - - running tests using [plenary.nvim](https://github.com/nvim-lua/plenary.nvim) and [busted](https://olivinelabs.com/busted/) |
27 | | - - check for formatting errors (Stylua) |
28 | | - - vimdocs autogeneration from README.md file |
29 | | - - luarocks release (LUAROCKS_API_KEY secret configuration required) |
| 67 | +### Commands |
30 | 68 |
|
31 | | -### Plugin structure |
| 69 | +- `:Task <task_name>`: Run a specific task by name |
| 70 | +- `:Task`: Show a floating task selector with preview |
| 71 | +- `:TaskRerun`: Rerun the last executed task |
32 | 72 |
|
33 | | -``` |
34 | | -. |
35 | | -├── lua |
36 | | -│ ├── plugin_name |
37 | | -│ │ └── module.lua |
38 | | -│ └── plugin_name.lua |
39 | | -├── Makefile |
40 | | -├── plugin |
41 | | -│ └── plugin_name.lua |
42 | | -├── README.md |
43 | | -├── tests |
44 | | -│ ├── minimal_init.lua |
45 | | -│ └── plugin_name |
46 | | -│ └── plugin_name_spec.lua |
47 | | -``` |
| 73 | +You can also bind a key to rerun using the `keymaps.rerun` config. |
0 commit comments