A Neovim plugin for automatic coding activity tracking. Works with the ShellTime daemon to monitor your development time across projects.
- Automatic Time Tracking - Passively monitors coding activity
- Language Detection - Auto-detects programming language from filetype
- Project Analytics - Tracks time per project/workspace
- Git Integration - Records activity by git branch
- Event Debouncing - Efficient heartbeat batching (30s cooldown per file)
- Offline Support - Queues heartbeats when daemon unavailable
curl -sSL https://shelltime.xyz/i | bashAfter installation, reload your shell configuration:
- zsh:
source ~/.zshrc - fish:
source ~/.config/fish/config.fish - bash:
source ~/.bashrc
shelltime initThis will:
- Open your browser to authenticate with your ShellTime account
- Install shell hooks for your shell (zsh/fish/bash)
- Start the ShellTime daemon
Add the following to your ShellTime config (~/.shelltime/config.yaml):
codeTracking:
enabled: trueOr in TOML format (~/.shelltime/config.toml):
[codeTracking]
enabled = true- Neovim >= 0.10.0
- Git (optional, for branch tracking)
{
"shelltime/coding-extension-vim",
event = "VeryLazy",
opts = {},
}use {
"shelltime/coding-extension-vim",
config = function()
require("shelltime").setup()
end
}Plug 'shelltime/coding-extension-vim'Then add to your init.lua:
require("shelltime").setup()-
Complete the Prerequisites - Install CLI, authenticate, and enable code tracking
-
Install the plugin using your preferred plugin manager (see above)
-
Start coding - The plugin automatically tracks your activity!
The plugin reads settings from ~/.shelltime/config.yaml by default:
-- Default setup (uses ~/.shelltime/config.yaml)
require("shelltime").setup()
-- Custom config path
require("shelltime").setup({
config = "/path/to/your/config.yaml",
})| Option | Type | Default | Description |
|---|---|---|---|
socketPath |
string | /tmp/shelltime.sock |
Unix socket path for daemon |
codeTracking.enabled |
boolean | true |
Enable/disable tracking |
debug |
boolean | false |
Enable debug logging |
| Command | Description |
|---|---|
:ShellTimeStatus |
Show daemon connection status and pending heartbeats |
:ShellTimeFlush |
Manually flush pending heartbeats to daemon |
:ShellTimeEnable |
Enable tracking |
:ShellTimeDisable |
Disable tracking |
The plugin monitors these Neovim events:
| Event | Trigger |
|---|---|
BufEnter |
Opening a file |
TextChanged / TextChangedI |
Editing text |
BufWritePost |
Saving a file |
CursorMoved / CursorMovedI |
Moving cursor |
Heartbeats are:
- Debounced: Max 1 heartbeat per file per 30 seconds (except saves)
- Batched: Sent to daemon every 2 minutes
- Queued: Stored locally if daemon is unavailable
Each heartbeat includes:
- File info: Path, language, line count, cursor position
- Project info: Name, root path, git branch
- Editor info: Neovim version, plugin version
- System info: Hostname, OS, OS version
- Activity: Timestamp, whether it was a save event
-
Check if daemon is running:
ls -la /tmp/shelltime.sock # If not present, run: shelltime init -
Verify config file exists:
cat ~/.shelltime/config.yaml -
Enable debug mode in config:
debug: true
-
Check status in Neovim:
:ShellTimeStatus
Run :ShellTimeStatus to check:
- If "Disconnected", ensure daemon is running
- If pending heartbeats > 0, try
:ShellTimeFlush