Skip to content

Shows the current playtime of your working directory that nvim is open in since the first time you opened it.

License

Notifications You must be signed in to change notification settings

HarshK200/playtime.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

About

Wanna flex 💪 in front of your friend about how much time you've wasted on your personal project.

Might i suggest you playtime.nvim

image


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 💪

INSTALLATION

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,
}

USAGE

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>")

Configuration

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
}

About

Shows the current playtime of your working directory that nvim is open in since the first time you opened it.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages