Giter Club home page Giter Club logo

tomato-timer.nvim's Introduction

tomato-timer.nvim

Focus tomato timer ๐Ÿ… ๐Ÿ•— ๐ŸŽฏ

Install

Packer

use { 'Kevalin/tomato-timer.nvim', requires = 'rcarriga/nvim-notify' }

Configuration

You can setup four variables:

  • chunk, it means a long break after running how many rounds. Default value is 4 times.
  • round, it means the time of each focus. Default value is 25 minutes.
  • short_break, it means the time of each short break, and after every focus there is a short break. Default value is 5 minutes.
  • long_break, it means the time of each long break, and after 4 times focus there is a long break. Default value is 15 minutes.
local ok, tomato = pcall(require, 'tomato')
if not ok then return end

tomato.setup({
  chunk = 4,
  round = 25,
  short_break = 5,
  long_break = 15,
})

Usage

To add configuration to lualine, you can edit the require'lualine'.setup function in your init.lua file.

For example, to add a new section to lualine that displays the current git branch, you can add the following code to the require'lualine'.setup function:

lualine.setup {
  options = {
    icons_enabled = true,
    theme = "tokyonight",
    component_separators = { left = "๎‚ฑ", right = "๎‚ณ" },
    section_separators = { left = "๎‚ฐ", right = "๎‚ฒ" },
    disabled_filetypes = {},
    always_divide_middle = true,
  },
  sections = {
    lualine_a = { "mode" },
    lualine_b = { "branch", "diff", "diagnostics" },
    lualine_c = {
      { "filename" },
      require('tomato').message
    },
    lualine_x = { "encoding", "fileformat", "filetype" },
    lualine_y = { "progress" },
    lualine_z = { "location" },
  },
  inactive_sections = {
    lualine_a = {},
    lualine_b = {},
    lualine_c = { "filename" },
    lualine_x = { "location" },
    lualine_y = {},
    lualine_z = {},
  },
  tabline = {},
  extensions = {},
}

You can get a timer on your lualine. Like this:

ๅ›พ็‰‡

ๅ›พ็‰‡

ๅ›พ็‰‡

ๅ›พ็‰‡

start timer

lua require('tomato').start_round()

Next, It will automatically start the timer in a loop.

reset timer

lua require('tomato').reset()

keymaps

You can also set some shortcut keys, such as my current configuration:

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

map('n', '<C-t>', "<cmd>lua require('tomato').start_round()<CR>", opts)
map('n', '<C-r>', "<cmd>lua require('tomato').reset()<CR>", opts)

TODO

  • a control float window
  • a stats html about focus detail data

tomato-timer.nvim's People

Contributors

kevalin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.