Entirely GPT 5.5 generated
A tiny Neovim plugin that tracks characters added and deleted while you are in insert mode.
It keeps daily totals:
added: characters inserteddeleted: characters removednet:added - deleted
The statusline text shows today's net, for example:
LOC +123
With lazy.nvim:
{
"your-name/loc.nvim",
config = function()
require("loc").setup()
end,
}loc.nvim does not overwrite your statusline. Add the exposed function wherever
you want it.
Built-in statusline:
vim.o.statusline = vim.o.statusline .. " %{v:lua.require'loc'.statusline()}"With lualine.nvim:
require("lualine").setup({
sections = {
lualine_x = {
function()
return require("loc").statusline()
end,
},
},
})The plugin defines these commands when it is on your runtimepath:
:LocEnablestarts tracking.:LocDisablestops tracking.:LocResetclears today's counters.:LocStatsprints today's counters.
Calling require("loc").setup() enables tracking by default. Use this if you
want to configure the plugin but start it manually:
require("loc").setup({ auto_enable = false })Defaults:
require("loc").setup({
auto_enable = true,
persist = true,
data_path = nil,
save_delay_ms = 1000,
statusline_prefix = "LOC",
})When data_path is nil, stats are stored at:
stdpath("data")/loc.nvim/stats.json
Stats are stored by local date:
{
"2026-04-30": {
"added": 123,
"deleted": 45
}
}With persist = false, daily counters stay in memory only for the current
Neovim process.
require("loc").enable()
require("loc").disable()
require("loc").reset()
require("loc").save()
require("loc").statusline()
require("loc").stats()stats() returns today's counters:
{
added = 123,
deleted = 45,
net = 78,
}From the repository root:
nvim --headless -u NONE -i NONE -l test/loc_spec.lua