Skip to content

fiqryq/wakastat.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

wakastat.nvim

Display your WakaTime coding stats in your Neovim statusline β€” supports daily, weekly, or monthly views with custom formatting and auto-refresh.

CleanShot 2025-08-09 at 21 44 35

✨ Features

  • Async WakaTime CLI integration
  • Show coding time for today, this week, or this month
  • Custom text formatting
  • Auto-refresh (default: every 5 minutes)
  • Easy integration with heirline.nvim
  • Works with AstroNvim, LazyVim, and more

πŸ“¦ Requirements

  • wakatime-cli installed and in your PATH
  • WakaTime API key in ~/.wakatime.cfg

Install wakatime-cli

Choose one:

pip install wakatime             # Python
brew install wakatime-cli        # macOS/Linux
scoop install wakatime-cli       # Windows
choco install wakatime           # Windows
npm install -g @wakatime/cli     # Node.js
go install github.com/wakatime/wakatime-cli@latest
sudo apt install wakatime        # Debian/Ubuntu

Check:

wakatime-cli --version

πŸš€ Installation & Setup (Lazy.nvim)

return {
  {
    "fiqryq/wakastat.nvim",
    event = "VeryLazy",
    cmd = { "WakastatRefresh", "WakastatStatus" },
    opts = {
      args = { "--today" },                  -- or "--week", "--month"
      format = "Today Coding Time: %s",      -- %s replaced with time
      update_interval = 300,                 -- seconds between updates
      enable_timer = true,
    },
    config = function(_, opts)
      require("wakastat").setup(opts)
    end,

    specs = {
      {
        "rebelot/heirline.nvim",
        optional = true,
        opts = function(_, opts)
          opts.statusline = opts.statusline or {}
          table.insert(opts.statusline, 5, {  -- insert at position 5
            provider = function()
              return " " .. require("wakastat").status() .. " "
            end,
            hl = "Wakastat",
            update = { "User", pattern = "WakastatUpdated" },
          })
        end,
      },
    },
  },
}

βš™οΈ Options

{
  args = { "--today" },            -- CLI arguments
  format = "Today Coding Time: %s",-- display format
  update_interval = 300,           -- update frequency (seconds)
  enable_timer = true,             -- auto-refresh
}

Common args values:

  • { "--today" } β€” today’s coding time
  • { "--week" } β€” this week
  • { "--month" } β€” this month
  • { "--year" } β€” this year

πŸ›  Troubleshooting

  • No data β†’ Make sure WakaTime is tracking and your API key is set in ~/.wakatime.cfg
  • CLI not found β†’ Install wakatime-cli and confirm with wakatime-cli --version
  • Not updating β†’ Lower update_interval or run :WakastatRefresh

About

wakatime coding status on your neovim.

Topics

Resources

License

Stars

Watchers

Forks

Languages