Code Monkey home page Code Monkey logo

nomodoro's Introduction

logo

Finally, Nvim + Pomodoro!

Yes, its another Pomodoro plugin for Nvim. Originally made to my own use and to learn the basics of plugin creation with Neovim.

I decided to leave this available for everyone that can find it useful also and please feel free to use, copy, comment or change anything you want.

demo

Features

  • Setup your pomodoro sessions time
  • Start and Stop sessions
  • Show status realtime from other plugins
  • Not just Pomodoro focused! Custom timer for any use

Quickstart

Instalation

Using vim-plug

Plug 'dbinagi/nomodoro'

Setup

To load plugin with default configuration:

require('nomodoro').setup({})

Setup

Default Configuration

require('nomodoro').setup({
    work_time = 25,
    short_break_time = 5,
    long_break_time = 15,
    break_cycle = 4,
    menu_available = true,
    texts = {
        on_break_complete = "TIME IS UP!",
        on_work_complete = "TIME IS UP!",
        status_icon = "🍅 ",
        timer_format = '!%0M:%0S' -- To include hours: '!%0H:%0M:%0S'
    },
    on_work_complete = function() end,
    on_break_complete = function() end
})

Commands

Command Description
NomoWork Start work timer
NomoBreak Start break timer
NomoStop Stop all timers
NomoStatus Print time left manually
NomoTimer N Runs a timer for N minutes
NomoPause Pauses current timer
NomoContinue Resumes current timer

Configure keys

By default, no shortcuts are provided, you could configure the following.

local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }

map('n', '<leader>nw', '<cmd>NomoWork<cr>', opts)
map('n', '<leader>nb', '<cmd>NomoBreak<cr>', opts)
map('n', '<leader>ns', '<cmd>NomoStop<cr>', opts)

Optional UI

Integration with lualine

As an example, to integrate the status realtime with lualine use the following:

local lualine = require'lualine'
lualine.setup({
    sections = {
        lualine_x = {
            require('nomodoro').status,
        }
    }
})

Integration with nui.menu

If you like menus, you can install the dependency nui.menu and you will have enable a command NomoMenu to display options in a popup

menu

Contributions

Contributions are more than welcome! Thanks to:

@gaardhus @nfwyst

nomodoro's People

Contributors

dbinagi avatar gaardhus avatar dmallubhotla avatar nfwyst avatar

Stargazers

ChengLei Shao avatar  avatar Jon Arrien avatar luismanolo avatar  avatar  avatar Antonio Fearon avatar Surya B avatar Alex Lewis avatar Phạm Hoàng Tuấn Kha avatar Meet Mangukiya avatar Ian Stapleton Cordasco avatar  avatar William Andres Rodriguez Borja avatar Dimas Cyriaco avatar Rick Barnes avatar Daniel avatar  avatar  avatar Sayan Bhattacharjee avatar  avatar andre avatar  avatar Kristijan Husak avatar darzok avatar  avatar Max Ziegler avatar Patrick Walsh avatar Ryo Hirayama avatar Bronek avatar Marcus Xavier avatar Carlos avatar ryujinscales avatar Lee Jae-yeol avatar Andy Huynh avatar dimosz avatar Chaz avatar Bruno Romero avatar Patrick avatar Andrea Schiavini avatar Alok Singh avatar Nate Kane avatar Khalid H. Ahmed avatar  avatar Martin Kinoo avatar Lalit Kumar avatar Samuel Ludwig avatar Patryk Kielar avatar Vinícius Bispo avatar Martin Radimec avatar Emuel avatar Ellison avatar Bryant avatar Justin Smestad avatar Tim Tyrrell avatar SUGIYAMA Yoshio avatar Yuta Katayama avatar Viv Sedov avatar Akin avatar Kevin Manca avatar

Watchers

 avatar

nomodoro's Issues

Problem with on_xx_complete

Hello, How are you? I hope you're doing well!

I have a problem where 'on_work_complete' executes when I complete a break
Here is what I'm trying to do:
2022-08-10_22:17:28

Callbacks for on_break_complete and on_work_complete

Thanks for this plugin.

Is there any way to hook into on_break_complete and on_work_complete?
I want to play a sound or show a floating window in the above cases.
A callback for the above events would make this possible.

License?

I noticed the repo doesn't have a license. Can I clone and do some modifications for my own use?
I would like to sync the timer between multiple neovim instances. I don't know if that interests you, if so I can submit a PR to add this functionality in this repo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.