UP | HOME

NeoProcess

Table of Contents

NeoProcess

A process management system that integrates with Snacks picker for visual process management.

Prerequisites

Overview

NeoProcess provides a unified interface for defining and running multi-command processes. It integrates with the Snacks picker to visualize and manage processes interactively.

Features

  • Define named processes with multiple commands
  • Visual process selection via Snacks picker
  • Process state tracking (ready, running, paused, finished, aborted, failed)
  • Event-driven architecture for process lifecycle

Usage

Quick Start

  1. Define processes in your Neovim config:
-- Initialize with an empty process list (add processes later via the API)
require("yalms.neoprocess").setup(true)

-- Or define processes inline:
require("yalms.neoprocess").setup({
  processes = {
    {
      name = "build",
      desc = "Build the project",
      commands = {
        { name = "clean", exec = "rm -rf dist" },
        { name = "compile", exec = "make all" },
      },
    },
  },
})

Passing true to setup() initialises the manager with no processes — useful when you want to add processes programmatically later.

  1. Open the picker: :Snacks picker process
  2. Select a process and press Alt-Enter to run

Running Processes

You can also run processes programmatically:

local manager = require("yalms.neoprocess").get()

-- Run a specific process by name
manager:run("build")

-- Run all processes
manager:run()

Picker Integration

NeoProcess registers a process picker source in Snacks. Access it via the picker:

  • :Snacks picker process - Open process picker
  • <a-r> - Run selected process (normal/visual mode)
  • <a-s> - Pause/Resume selected process

The picker shows process name, state icon, and provides a preview with command list and last run timestamp.

State Icons

State Icon
ready 󰒞
running 󰁋
paused 󰬬
finished 󰄳
aborted 󰛹
failed 󰁙

API Reference

See NeoProcess API for full API documentation.