It shows the time you've spent on the current project ever since you first open the current project. The time is presisted between session just so you can flex harder 💪
NOTE: this requires nvim-lua/plenary.nvim so plug users have that installed
Plug
Plug "harshk200/playtime.nvim"Lazy.nvim:
return {
"harshk200/playtime.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require("playtime").setup({
window = {
relative = "editor",
width = 8,
height = 1,
row = 0, -- row does defnies where to place on the y axis
col = vim.o.columns, -- column does defines where to place on the x axis
style = "minimal",
focusable = false,
noautocmd = true,
border = "rounded",
anchor = "NW",
zindex = 150,
},
win_visible_on_startup = true, -- the window is visible on startup by default
})
end,
}You can call :PlaytimeToggle vim command to hide/show the timer window
NOTE: even if the window is hidden the timer doesn't stop, it continues to run in the background
You can remap the above if you like
vim.keymap.set("n", "<leader>pt", ":PlaytimeToggle<CR>")Default config options for window
-- window config options (they are for the vim.api.nvim_open_win() so you can provide anything you want for your styling)
local default_opts = {
window = {
relative = "editor",
width = 8,
height = 1,
row = 0, -- row does defnies where to place on the y axis
col = vim.o.columns, -- column does defines where to place on the x axis
style = "minimal",
focusable = false,
noautocmd = true,
border = "rounded",
anchor = "NW",
zindex = 150,
},
win_visible_on_startup = true, -- the window is visible on startup by default
}