Compare commits

4 Commits
Author SHA1 Message Date
swaits d9867fd6f8 chore: repoint remaining links and host-specific tooling at git.swaits.com
CI / lint (push) Canceled after 0s
CI / test (push) Canceled after 0s
Covers files missed by the first pass (.svelte/.astro components, bare org and
profile links, plugin doc headers), plus content that needed rewriting rather
than a URL swap: the chezmoi bootstrap script now provisions SSH for
git.swaits.com (User git, port 2222) and initialises from Gitea.

Link labels were updated to match their new targets.
2026-08-31 18:35:29 -06:00
swaits facd7bb0f2 chore: repoint remaining links at git.swaits.com
CI / lint (push) Canceled after 0s
CI / test (push) Canceled after 0s
Rewrites lingering github.com / *.sr.ht references to this Gitea instance,
translating GitHub and Sourcehut URL shapes to Gitea's (/blob/<ref>/ and
sr.ht /tree/<ref>/item/ -> /src/branch/<ref>/, /tree/<tag> -> /src/tag/<tag>,
/actions/workflows/X -> /actions?workflow=X, /edit/ -> /_edit/).

Left pointing at the old hosts on purpose: pull-request links (PRs were not
migrated), forks that were never migrated, and GitHub-only surfaces Gitea
lacks. OpenPGP identity proofs are untouched by design.
2026-08-31 18:32:32 -06:00
swaits 1e3e51d845 refactor: replace ivy layout with large float, hide search input
CI / lint (push) Canceled after 0s
CI / test (push) Canceled after 0s
2026-04-12 20:26:17 -06:00
swaits bd4e6456d1 fix: replace progress bar with simple notify-based update tracking 2026-04-09 23:17:09 -06:00
5 changed files with 36 additions and 92 deletions

No files matched your search

+1 -1
View File
@@ -20,4 +20,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Configurable command name via `command` option
- `picker` option to force fallback UI for testing
[0.1.0]: https://github.com/swaits/tiny-packupdate.nvim/releases/tag/v0.1.0
[0.1.0]: https://git.swaits.com/swaits/tiny-packupdate.nvim/releases/tag/v0.1.0
+1 -1
View File
@@ -28,7 +28,7 @@ https://github.com/user-attachments/assets/TODO-SCREENCAST
Add to your `vim.pack.add()` call:
```lua
"https://github.com/swaits/tiny-packupdate.nvim",
"https://git.swaits.com/swaits/tiny-packupdate.nvim",
```
Then in your config:
+3
View File
@@ -0,0 +1,3 @@
-ck remove PackFetch
- audit thethethe.nvim for tiny'ization
- what else can we remove from our config?
+2 -2
View File
@@ -1,6 +1,6 @@
*tiny-packupdate.txt* Minimal vim.pack updater with progress bar & results picker
Author: Stephen Waits <https://github.com/swaits>
Author: Stephen Waits <https://git.swaits.com/swaits>
License: MIT
==============================================================================
@@ -31,7 +31,7 @@ changelogs, and an optional snacks.nvim picker for browsing results.
Add to your |vim.pack.add()| call: >lua
"https://github.com/swaits/tiny-packupdate.nvim",
"https://git.swaits.com/swaits/tiny-packupdate.nvim",
<
Then in your config: >lua
+29 -88
View File
@@ -1,11 +1,9 @@
-- tiny-packupdate.nvim: minimal vim.pack updater with progress bar & results picker
-- tiny-packupdate.nvim: minimal vim.pack updater with results picker
-- Requires Neovim 0.12+ (vim.pack API)
local M = {}
local state = nil -- nil = idle; table = running
local cfg = { command = "PackUpdate", auto = "manual" }
local ns = vim.api.nvim_create_namespace("tiny-packupdate")
local BAR_W = 40
local LOG_FMT = "--pretty=format:commit %h%nAuthor: %an%nDate: %cr%n%n %s%n"
-- ── Timestamp persistence (for auto-update cadence) ───────────────────
@@ -31,70 +29,16 @@ local function write_stamp()
end
end
-- ── Progress bar UI ───────────────────────────────────────────────────
local function progress_draw()
if not state or not state.buf or not vim.api.nvim_buf_is_valid(state.buf) then
return
end
local elapsed = (vim.uv.hrtime() - state.t0) / 1e9
local pct = state.complete and 1.0 or (0.9 * (1 - math.exp(-elapsed / 5)))
local tag = state.changed > 0 and string.format(" %d new ", state.changed) or ""
local bw = BAR_W - 2 - #tag
local filled = math.floor(pct * bw)
local line = " " .. string.rep("█", filled) .. string.rep("░", bw - filled) .. tag
vim.api.nvim_buf_set_lines(state.buf, 0, -1, false, { line })
vim.api.nvim_buf_clear_namespace(state.buf, ns, 0, -1)
if filled > 0 then
-- █ is 3 bytes in UTF-8
vim.api.nvim_buf_add_highlight(state.buf, ns, "TinyPackProgress", 0, 1, 1 + filled * 3)
end
end
local function progress_open()
local buf = vim.api.nvim_create_buf(false, true)
vim.bo[buf].bufhidden = "wipe"
state.buf = buf
state.win = vim.api.nvim_open_win(buf, false, {
relative = "editor",
row = math.floor(vim.o.lines / 3),
col = math.floor((vim.o.columns - BAR_W) / 2),
width = BAR_W,
height = 1,
style = "minimal",
border = "rounded",
title = " " .. cfg.command .. " ",
title_pos = "center",
noautocmd = true,
})
state.t0 = vim.uv.hrtime()
state.anim = vim.uv.new_timer()
state.anim:start(0, 16, vim.schedule_wrap(progress_draw))
end
local function progress_close()
if not state then
return
end
if state.anim then
state.anim:stop()
state.anim:close()
state.anim = nil
end
if state.win and vim.api.nvim_win_is_valid(state.win) then
vim.api.nvim_win_close(state.win, true)
end
end
-- ── Results display ───────────────────────────────────────────────────
local function show_results(results)
progress_close()
if #results == 0 then
vim.notify("All plugins up to date", vim.log.levels.INFO)
vim.notify("All plugins already up to date", vim.log.levels.INFO)
state = nil
return
end
local n = #results
vim.notify(string.format("Updated %d plugin%s", n, n == 1 and "" or "s"), vim.log.levels.INFO)
local ok, snacks = pcall(require, "snacks")
if ok and snacks.picker then
local items = {}
@@ -110,7 +54,19 @@ local function show_results(results)
title = cfg.command .. " Results",
items = items,
preview = "preview",
layout = { preset = "ivy" },
layout = {
hidden = { "input" },
layout = {
box = "horizontal",
width = 0.9,
height = 0.9,
border = "rounded",
title = "{title}",
title_pos = "center",
{ win = "list", border = "none", width = 0.3 },
{ win = "preview", title = "{preview}", border = "left", width = 0.7 },
},
},
format = function(item)
return { { item.text } }
end,
@@ -216,15 +172,6 @@ local function collect_and_show()
end
end
-- ── Completion detection ──────────────────────────────────────────────
local function on_complete()
write_stamp()
state.complete = true
progress_draw()
vim.defer_fn(collect_and_show, 400)
end
-- ── Main update ───────────────────────────────────────────────────────
function M.update()
@@ -243,36 +190,31 @@ function M.update()
return vim.notify("No active plugins", vim.log.levels.INFO)
end
state = { snapshot = snapshot, total = #names, changed = 0 }
progress_open()
state = { snapshot = snapshot, changed = 0 }
local timer = vim.uv.new_timer()
local au_id
local function reset_debounce()
timer:stop()
timer:start(
2000,
0,
vim.schedule_wrap(function()
pcall(vim.api.nvim_del_autocmd, au_id)
timer:close()
on_complete()
end)
)
local function on_done()
pcall(vim.api.nvim_del_autocmd, au_id)
timer:close()
write_stamp()
collect_and_show()
end
au_id = vim.api.nvim_create_autocmd("PackChanged", {
callback = function()
callback = function(ev)
if not state then
return pcall(vim.api.nvim_del_autocmd, au_id)
end
state.changed = state.changed + 1
progress_draw()
reset_debounce()
local name = ev.data and ev.data.spec and ev.data.spec.name or "plugin"
vim.notify(string.format("Updated %s (%d)", name, state.changed), vim.log.levels.INFO)
timer:stop()
timer:start(2000, 0, vim.schedule_wrap(on_done))
end,
})
reset_debounce()
timer:start(2000, 0, vim.schedule_wrap(on_done))
vim.pack.update(names, { force = true })
end
@@ -281,7 +223,6 @@ end
function M.setup(opts)
vim.g.tiny_packupdate_loaded = true
cfg = vim.tbl_extend("force", cfg, opts or {})
vim.api.nvim_set_hl(0, "TinyPackProgress", { default = true, link = "DiagnosticOk" })
vim.api.nvim_create_user_command(cfg.command, M.update, { desc = "Update all plugins" })
local interval = auto_intervals[cfg.auto]
if interval and os.time() - read_stamp() >= interval then