22022024-1

This commit is contained in:
foozzi 2024-02-22 22:39:09 -05:00
parent 6d5a3deaf3
commit 2c6c55cbe7
5 changed files with 65 additions and 2 deletions

View file

@ -1,3 +1,4 @@
-- local helpers = require("core.helpers")
-- auto-format on save
local lsp_fmt_group = vim.api.nvim_create_augroup("LspFormattingGroup", {})
vim.api.nvim_create_autocmd("BufWritePre", {
@ -21,3 +22,8 @@ vim.api.nvim_create_autocmd("TextYankPost", {
vim.highlight.on_yank()
end,
})
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- pattern = "*",
-- callback = helpers.UpdateOrAppendTimestamp,
-- })

View file

@ -0,0 +1,29 @@
-- local UpdateOrAppendTimestamp = function()
-- if vim.bo.filetype == "telekasten" then
-- local line_found = false
-- local update_marker = "!!!update at"
-- local new_timestamp = os.date("!%Y-%m-%d %H:%M!!!")
-- for line_number = 1, vim.api.nvim_buf_line_count(0) do
-- local line = vim.api.nvim_buf_get_lines(0, line_number - 1, line_number, false)[1]
-- if line:find(update_marker) then
-- print("tst")
-- vim.api.nvim_buf_set_lines(
-- 0,
-- line_number - 1,
-- line_number,
-- false,
-- { update_marker .. " " .. new_timestamp }
-- )
-- line_found = true
-- break
-- end
-- end
-- if not line_found then
-- vim.api.nvim_buf_set_lines(0, -1, -1, false, { update_marker .. " " .. new_timestamp })
-- end
-- end
-- end
--
-- return {
-- UpdateOrAppendTimestamp = UpdateOrAppendTimestamp,
-- }