From 06aa559f07abe0ebf2329ad56a1697be7428237c Mon Sep 17 00:00:00 2001 From: Dane Sabo Date: Tue, 2 Sep 2025 21:00:29 -0400 Subject: [PATCH] hehe --- lua/custom/chadrc.lua | 4 +- lua/custom/zk.lua | 118 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 2 deletions(-) diff --git a/lua/custom/chadrc.lua b/lua/custom/chadrc.lua index 0f1c60f..92ee71e 100644 --- a/lua/custom/chadrc.lua +++ b/lua/custom/chadrc.lua @@ -7,8 +7,8 @@ M.ui = { hl_add = {}, hl_override = {}, changed_themes = {}, - theme_toggle = { "melange", "one_light" }, - theme = "melange", -- default theme + theme_toggle = { "ayu_light", "one_light" }, + theme = "ayu_light", -- default theme transparency = false, lsp_semantic_tokens = false, -- needs nvim v0.9, just adds highlight groups for lsp semantic tokens diff --git a/lua/custom/zk.lua b/lua/custom/zk.lua index fdea363..2e0bba8 100644 --- a/lua/custom/zk.lua +++ b/lua/custom/zk.lua @@ -251,13 +251,129 @@ local function new_hub_note(opts) vim.cmd.edit(path) end end +-- ---------- :ZkNewLit ---------- +-- Lightweight Literature (three-pass) note creator. +-- Files live under: Permanent Notes/Literature +-- Naming: LIT-YYYYMMDDHHMMSS-.md +local literature_dir = permanent_dir .. "/Literature Notes" + +local function new_literature_note(opts) + local title = table.concat(opts.fargs or {}, " ") + if title == "" then + title = vim.fn.input "Literature note title (paper title or handle): " + end + if not title or title == "" then + vim.notify("Aborted: empty title.", vim.log.levels.WARN) + return + end + + local id = "LIT-" .. os.date "%Y%m%d%H%M%S" + local slug = slugify(title) + local filename = string.format("%s-%s.md", id, slug) + + ensure_dir(literature_dir) + local path = literature_dir .. "/" .. filename + + local created = iso_utc() + + local ok = write_if_missing(path, { + "---", + "id: " .. id, + "title: " .. title, + "type: literature", + "created: " .. created, + "modified: " .. created, + "citekey: ", -- just paste your Zotero citekey here + "---", + "", + "# " .. title, + "", + "## First Pass", + "**Category:** ", + "", + "**Context:** ", + "", + "**Correctness:** ", + "", + "**Contributions:** ", + "", + "**Clarity:** ", + "", + "## Second Pass", + "**What is the main thrust?**", + "", + "**What is the supporting evidence?**", + "", + "**What are the key findings?**", + "", + "## Third Pass", + "**Recreation Notes:**", + "", + "**Hidden Findings:**", + "", + "**Weak Points? Strong Points?**", + "", + }) + if ok then + vim.cmd.edit(path) + end +end + +vim.api.nvim_create_user_command( + "ZkNewLit", + new_literature_note, + { nargs = "*", desc = "Create a new literature ZK note (three-pass template) and open it" } +) + +-- Keymap (optional): zl vim.api.nvim_create_user_command( "ZkNewHub", new_hub_note, { nargs = "*", desc = "Create a new hub (structure) note and open it" } ) +local thesis_dir = permanent_dir .. "/Thesis" +local function new_thesis_note(opts) + local title = table.concat(opts.fargs or {}, " ") + if title == "" then + title = vim.fn.input "Thesis note title: " + end + if not title or title == "" then + vim.notify("Aborted: empty title.", vim.log.levels.WARN) + return + end + + local id = "DR-" .. os.date "%Y%m%d%H%M%S" + local slug = slugify(title) + local filename = string.format("%s-%s.md", id, slug) + + ensure_dir(thesis_dir) + local path = thesis_dir .. "/" .. filename + + local created = iso_utc() + + local ok = write_if_missing(path, { + "---", + "id: " .. id, + "title: " .. title, + "type: thesis", + "created: " .. created, + "modified: " .. created, + "tags: []", + "---", + "", + }) + if ok then + vim.cmd.edit(path) + end +end + +vim.api.nvim_create_user_command( + "ZkNewThesis", + new_thesis_note, + { nargs = "*", desc = "Create a new thesis ZK note and open it" } +) -- ---------- keymaps ---------- -- zn : new permanent -- zd : today's daily @@ -265,3 +381,5 @@ vim.api.nvim_create_user_command( vim.keymap.set("n", "zn", ":ZkNewPermanent ", { desc = "ZK: New permanent note" }) vim.keymap.set("n", "zd", ":ZkNewDaily", { desc = "ZK: Open/create today's daily" }) vim.keymap.set("n", "zh", ":ZkNewHub ", { desc = "ZK: New hub (structure) note" }) +vim.keymap.set("n", "zl", ":ZkNewLit ", { desc = "ZK: New literature note" }) +vim.keymap.set("n", "zt", ":ZkNewThesis ", { desc = "ZK: New thesis note" })