Skip to content

orumin/pomodoro.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pomodoro.nvim

A Neovim plugin written (mostly) in Lua that implements the Pomodoro technique. This implemenation is derived from https://github.com/wthollingsworth/pomodoro.nvim

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.

require("lazy").setup({
  "orumin/pomodoro.nvim",
  lazy = true
  dependencies = "MunifTanjim/nui.nvim",
  cmd = { "PomodoroStart", "PomodoroStatus", "PomodoroStop" },
  config = true
})

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. Also, status icon, popup menu window style and popup menu keymaps is configurable The values shown below are the defaults.

require("pomodoro").setup({
  time_work = 25,
  time_break_short = 5,
  time_break_long = 20,
  timers_to_long_break = 4,
  icons = {
    stopped = "󰚭",
    started = "󰔟",
    breaking = "󰞌",
  },
  ui = {
    border = {
      style = "rounded",
      text = {
        top_align = "left",
      },
      padding = { 1, 3 },
    },
    position = "50%",
    size = {
      width = "25%",
    },
    opacity = 1,
  },
  keymap = {
    focus_next = { "j", "<Down>", "<Tab>" },
    focus_prev = { "k", "<Up>", "<S-Tab>" },
    close = { "<Esc>", "<C-c>" },
    submit = { "<CR>", "<Space>" },
  }
})

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%