diff --git a/flake.lock b/flake.lock index 4c78c98..9a93d6a 100644 --- a/flake.lock +++ b/flake.lock @@ -47,11 +47,28 @@ "type": "github" } }, + "plugins-pomo-nvim": { + "flake": false, + "locked": { + "lastModified": 1722376269, + "narHash": "sha256-tJ2TrypKnCnQm+6FDjX0KDr+UNoBBVvGIm+uWJtpNLc=", + "owner": "epwalsh", + "repo": "pomo.nvim", + "rev": "aa8decc421d89be0f10b1fc6a602cdd269f350ff", + "type": "github" + }, + "original": { + "owner": "epwalsh", + "repo": "pomo.nvim", + "type": "github" + } + }, "root": { "inputs": { "nixCats": "nixCats", "nixpkgs": "nixpkgs", - "plugins-blink-ripgrep": "plugins-blink-ripgrep" + "plugins-blink-ripgrep": "plugins-blink-ripgrep", + "plugins-pomo-nvim": "plugins-pomo-nvim" } } }, diff --git a/flake.nix b/flake.nix index 37fe921..cb056ab 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,11 @@ url = "github:mikavilpas/blink-ripgrep.nvim"; flake = false; }; + + plugins-pomo-nvim = { + url = "github:epwalsh/pomo.nvim"; + flake = false; + }; }; outputs = { @@ -81,6 +86,8 @@ black stylua marksman + + libnotify ]; }; @@ -130,6 +137,7 @@ optionalPlugins = { gitPlugins = with pkgs.neovimPlugins; [ blink-ripgrep + pomo-nvim ]; general = with pkgs.vimPlugins; [ nvim-autopairs diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 6d41c42..57a24fd 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -32,7 +32,23 @@ return { return require("lsp-progress").progress() end, }, - lualine_x = { "encoding", "fileformat" }, + lualine_x = { + function() + local ok, pomo = pcall(require, "pomo") + if not ok then + return "" + end + + local timer = pomo.get_first_to_finish() + if timer == nil then + return "" + end + + return "󰄉 " .. tostring(timer) + end, + "encoding", + "fileformat", + }, lualine_y = { "diff", "diagnostics" }, lualine_z = { "location" }, }, diff --git a/lua/plugins/lz-spec.lua b/lua/plugins/lz-spec.lua index c785ee9..d1d0992 100644 --- a/lua/plugins/lz-spec.lua +++ b/lua/plugins/lz-spec.lua @@ -217,6 +217,7 @@ return { lz.trigger_load("telescope.nvim") lz.trigger_load("nvim-lspconfig") + ---@diagnostic disable-next-line: missing-fields require("tailwind-tools").setup({ conceal = { enabled = true }, document_color = { enabled = true }, @@ -240,4 +241,47 @@ return { "oxocarbon.nvim", colorscheme = { "oxocarbon" }, }, + { + "pomo-nvim", + cmd = { "TimerStart", "TimerRepeat", "TimerSession" }, + after = function() + ---@diagnostic disable-next-line: missing-fields + require("pomo").setup({ + notifiers = { + { + name = "Default", + opts = { + sticky = false, + }, + }, + { name = "System" }, + }, + sessions = { + pomodoro = { + { name = "Work", duration = "25m" }, + { name = "Short Break", duration = "5m" }, + { name = "Work", duration = "25m" }, + { name = "Short Break", duration = "5m" }, + { name = "Work", duration = "25m" }, + { name = "Long Break", duration = "15m" }, + }, + grind = { + { name = "Work", duration = "45m" }, + { name = "Short Break", duration = "5m" }, + { name = "Work", duration = "45m" }, + }, + }, + }) + end, + keys = { + { + "fp", + function() + require("telescope").load_extension("pomodori") + require("telescope").extensions.pomodori.timers() + end, + desc = "Manage Pomodori Timers", + }, + }, + }, }