Skip to content

adriangitvitz/pm.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pm.nvim

Neovim plugin for project-manager-cli - A lightweight, command-first interface for managing tasks and projects from within Neovim.

Features

  • Command-line interface with vim.ui.input prompts for task management
  • Telescope integration for fuzzy finding tasks, projects, and workspaces
  • Floating detail view for task inspection
  • Workspace-aware task filtering
  • Time tracking integration
  • Statusline component support
  • Async CLI execution (non-blocking)
  • Smart caching for performance

Requirements

Installation

Using lazy.nvim

{
  'adriangitvitz/pm.nvim',
  dependencies = {
    'nvim-telescope/telescope.nvim',
  },
  config = function()
    require('pm').setup({
      -- Optional configuration
      pm_bin = 'pm', -- Path to pm binary
      cache_timeout = 300, -- 5 minutes
    })

    -- Load the telescope extension
    require('telescope').load_extension('pm')
  end,
}

Usage

Commands

Task Management

:PmTaskAdd [title] [--flags]       " Create a task (with prompts or flags)
:PmTaskAdd [title] --quick         " Create with defaults, skip prompts
:PmTaskEdit <task-id>              " Edit task (prompts for each field)
:PmTaskToggle [task-id]            " Toggle task status (todo -> doing -> done)
:PmTaskDelete <task-id>            " Delete task (with confirmation)
:PmTaskView [task-id]              " Open task detail in floating window
:PmTaskList                        " Open Telescope tasks picker

Workspace Management

:PmWorkspace [name]                " Set or show current workspace

Time Tracking

:PmTimeStart [task-id]             " Start time tracking for a task
:PmTimeStop                        " Stop time tracking
:PmTimeReport [today|week|month]   " Show time report in split

Projects

:PmProjectList                     " Open Telescope projects picker

Utility

:PmRefresh                         " Clear cache and refresh data

Telescope Integration

:Telescope pm tasks                " Fuzzy find tasks
:Telescope pm projects             " Fuzzy find projects
:Telescope pm workspaces           " Fuzzy find and switch workspaces

Telescope Keybindings (in picker)

  • <CR> - View task details
  • <C-t> - Toggle task status
  • <C-e> - Edit task
  • <C-d> - Delete task

Task Detail View Keybindings

When viewing task details in a floating window:

  • e - Edit task
  • t - Toggle status
  • d - Delete task
  • y - Yank task ID to clipboard
  • Y - Yank task as JSON to clipboard
  • q or <Esc> - Close window

Flags for PmTaskAdd

:PmTaskAdd Fix bug --priority high --project backend --tags bug,urgent --cl CL/123

Available flags:

  • --priority (or -p): low, normal, high, critical
  • --project: Project name or ID
  • --tags: Comma-separated tags
  • --changelist (or --cl): Changelist identifier
  • --workspace (or --ws): Workspace name
  • --description: Task description
  • --quick: Skip prompts, use defaults

Examples

Create a task with prompts

:PmTaskAdd Implement authentication
" Follow the prompts for priority, project, tags, etc.

Quick task creation

:PmTaskAdd Fix critical bug --quick

Create with all details

:PmTaskAdd Add dark mode --priority high --project frontend --tags ui,feature

Set workspace and list tasks

:PmWorkspace backend
:Telescope pm tasks

Toggle task from last selected

:Telescope pm tasks
" Select a task, press <Esc>
:PmTaskToggle

Statusline Integration

For lualine.nvim:

require('lualine').setup({
  sections = {
    lualine_x = {
      function()
        return require('pm').statusline()
      end,
    },
  },
})

Configuration

Full configuration with defaults:

require('pm').setup({
  -- Path to the pm binary
  pm_bin = 'pm',

  -- Cache timeout in seconds
  cache_timeout = 300,

  -- Floating window settings
  float = {
    border = 'rounded',
    width = 0.6,  -- Relative to editor width
    height = 0.7, -- Relative to editor height
  },

  -- Statusline settings
  statusline = {
    enabled = true,
    show_workspace = true,
    show_task_count = true,
    show_time_tracking = true,
  },

  -- Telescope settings
  telescope = {
    theme = nil, -- Use default telescope theme
  },

  -- Notification settings
  notifications = {
    enabled = true,
    timeout = 2000, -- milliseconds
  },
})

Workflow Example

  1. Set your workspace:
:PmWorkspace my-project
  1. Create tasks quickly:
:PmTaskAdd Implement feature X --priority high --tags backend
:PmTaskAdd Write tests --quick
  1. Browse and manage tasks:
:Telescope pm tasks
" Use fuzzy search to find tasks
" Press <C-t> to toggle status
" Press <CR> to view details
  1. Track time:
:PmTimeStart <task-id>
" Work on the task...
:PmTimeStop
  1. View reports:
:PmTimeReport today

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published