Skip to content

Commit 94af409

Browse files
committed
feat: add tips on startup
1 parent 99b78f2 commit 94af409

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: lua/config/autocmds.lua

+10-1
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,13 @@ end, { desc = "Set files with a she-bang as executable", group = augroup })
151151
create_autocmd("BufRead", function(ev)
152152
if vim.bo[ev.buf].buftype ~= "" then return end -- only on files
153153
vim.bo[ev.buf].modifiable = not vim.bo[ev.buf].readonly
154-
end)
154+
end, { desc = "Make read-only files non-modifiable", group = augroup })
155+
156+
create_autocmd("VimEnter", function()
157+
vim.system({ "curl", "-SsfL", "https://vtip.43z.one" }, nil, function(obj)
158+
local res = obj.stdout
159+
if obj.code ~= 0 then res = "Error fetching tip: " .. table.concat({ obj.stderr, obj.stdout }, "\n") end
160+
return vim.notify(res, vim.log.levels.INFO, { title = "In Case You Didn't Know!", timeout = 5000 })
161+
end)
162+
return true
163+
end, { desc = "Fetch tips from vtip.43z.one", group = augroup })

0 commit comments

Comments
 (0)