Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/EthanJWright/vs-tasks.nvim

A telescope plugin that runs tasks similar to VS Code's task implementation.
https://github.com/EthanJWright/vs-tasks.nvim

Last synced: 14 days ago
JSON representation

A telescope plugin that runs tasks similar to VS Code's task implementation.

Awesome Lists containing this project

README

        

# VS Tasks

Telescope plugin to load and run tasks in a project that conform to VS Code's [Editor Tasks](https://code.visualstudio.com/docs/editor/tasks)

## Features

- โš™ Run commands in a terminal!
- split or float the terminal
- source from ./vscode/tasks.json
- source from package.json scripts
- ๐Ÿ‘€ Run any task as a watched job
- ๐Ÿงต Run any task in the background as a job
- ๐Ÿ“– Browse history of completed background jobs
- โœ๏ธ edit input variables that will be used for the session
- Use VS Code's [variables](https://code.visualstudio.com/docs/editor/variables-reference) in the command (limited support, see desired features)
- Use VS Code's [launch.json](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) pattern (limited support)
- โŸณ Run tasks from your history, sorted by most used

## Example

Short Demo

![Short Demo](https://i.imgur.com/sQtRQdO.gif)

## Setup

With Plug:

```vim
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim' " make sure you have telescope installed
Plug 'EthanJWright/vs-tasks.nvim'
```

With Packer:

```vim
use {
'EthanJWright/vs-tasks.nvim',
requires = {
'nvim-lua/popup.nvim',
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim'
}
}
```

With Lazy:

```lua
{
"EthanJWright/vs-tasks.nvim",
dependencies = {
"nvim-lua/popup.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
}
```

Set up keybindings:

```vim
nnoremap ta :lua require("telescope").extensions.vstask.tasks()
nnoremap ti :lua require("telescope").extensions.vstask.inputs()
nnoremap th :lua require("telescope").extensions.vstask.history()
nnoremap tl :lua require('telescope').extensions.vstask.launch()
nnoremap tj :lua require("telescope").extensions.vstask.jobs()
nnoremap t; :lua require("telescope").extensions.vstask.jobhistory()
```

## Usage

### When the task telescope is open

- Enter will open in toggleterm
- Ctrl-v will open in a vertical split terminal
- Ctrl-p will open in a split terminal
- Ctrl-b will run the task as a job in the background
- Ctrl-w will run the task as as a job in the background, and watch the file

### When the jobs telescope is open

- Enter will open any output in a temporary buffer
- Ctrl-w will toggle the watch status
- Ctrl-k will kill the job

### Autodetect

VS Tasks can auto detect certain scripts from your package, such as npm
scripts.

## Configuration

- Configure harpoon use (auto cache terminals based on task)
- Configure toggle term use
- Configure terminal behavior
- Cache json conf sets whether the config will be ran every time. If the cache
is removed, this will also remove cache features such as remembering last
ran command

```lua
lua <