Skip to content

Run shell commands(tasks) in dedicated terminal windows

License

Notifications You must be signed in to change notification settings

eumis/tasks.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tasks.nvim

Run shell commands(tasks) in dedicated terminal windows.

Installation

  • neovim required
  • install using your favorite plugin manager

lazy.nvim

{
    "eumis/tasks.nvim"
}

mini.deps

add({
    source = "eumis/tasks.nvim"
})

packer

use {
    "eumis/tasks.nvim"
}

Usage

local tasks = require "tasks"

-- Add tasks
tasks.add("test all", "nvim --no-plugin --headless -c 'PlenaryBustedDirectory lua/tests'")
tasks.add("test current file", function(bufnr) return "nvim --headless -c 'PlenaryBustedFile " .. vim.fn.expand("#" .. bufnr) .. "'" end)

-- Run tasks
tasks.run("test all")
tasks.run_last()

-- Open task
tasks.open("test all")
tasks.open_last()

-- Open/close list of tasks
tasks.toggle_list()

-- Open list of tasks in telescope
require("telescope").extensions.tasks.all()
:TasksRun test all
:TasksRunLast
:TasksOpen test current file
:TasksOpenLast
:TasksOpenList
:TasksCloseList
:TasksToggleList

Config

-- default values
require "tasks".setup {
    run_keys = { "r", "<cr>" }, -- keys to run task from tasks list
    open_keys = { "o" }, -- keys to open task buffer from tasks list
    get_list_win_config = get_float_win_config, -- returns config for vim.api.nvim_open_win for list window
    get_task_win_config = get_float_win_config, -- returns config for vim.api.nvim_open_win for task window
    sort = "order", -- "order" - tasks in added order, "recent" - tasks run most recently are first
}

About

Run shell commands(tasks) in dedicated terminal windows

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages