uncomfyhalomacro / pomodoro.nvim

A Pomodoro timer for Neovim written in Lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pomodoro.nvim

A Neovim plugin written (mostly) in Lua that implements the Pomodoro technique.

Features

When a timer goes off, a menu is displayed to prompt you to take a break (or start the next pomodoro) with the option to stop the Pomodoro session.

nui-menu

When these prompts are displayed, you can also press b to take a break (if applicable), p to start the next pomodoro (if applicable), or q to stop the Pomodoro session.

Requirements

Installation

Install the plugin with your preferred package manager.

use {
    'wthollingsworth/pomodoro.nvim',
    requires = 'MunifTanjim/nui.nvim'
}

Configuration

You can configure the length of the pomodoro, the length of a short break, the length of a long break, and the number of pomodoros that must be completed in order to take a longer break. The values shown below are the defaults.

Lua

use {
    'wthollingsworth/pomodoro.nvim',
    requires = 'MunifTanjim/nui.nvim',
    config = function()
        require('pomodoro').setup({
            time_work = 25,
            time_break_short = 5,
            time_break_long = 20,
            timers_to_long_break = 4
        })
    end
}

Vimscript

let g:pomodoro_time_work = 25
let g:pomodoro_time_break_short = 5
let g:pomodoro_time_break_long = 20
let g:pomodoro_timers_to_long_break = 4

Usage

Three Ex commands are provided.

Command Description
:PomodoroStart Starts the timer.
:PomodoroStatus Displays the status of the timer in the message area.
:PomodoroStop Stops the Pomodoro session.

Showing the timer in the statusline

For hoob3rt/lualine.nvim, you can do something like:

require('lualine').setup({
    sections = {
        lualine_c = { 'filename', require('pomodoro').statusline }
    }
})

Alternatives

About

A Pomodoro timer for Neovim written in Lua

License:GNU General Public License v3.0


Languages

Language:Lua 94.9%Language:Vim Script 5.1%