diff --git a/nvim/.config/nvim/after/ftplugin/markdown.lua b/nvim/.config/nvim/after/ftplugin/markdown.lua index b15a268..739dcf6 100644 --- a/nvim/.config/nvim/after/ftplugin/markdown.lua +++ b/nvim/.config/nvim/after/ftplugin/markdown.lua @@ -1,6 +1,10 @@ local map = vim.keymap.set -require('which-key').register({ ["c" ] = { name = "+md-code"}}) -require('which-key').register({ ["e" ] = { name = "+criticmarkup"}}) +require("which-key").register({ ["c"] = { name = "+md-code" } }) +require("which-key").register({ ["e"] = { name = "+criticmarkup" } }) + +if require("zk.util").notebook_root(vim.fn.expand("%:p")) ~= nil then + map("n", "", "lua vim.lsp.buf.definition()", { silent = true }) +end -- edit code cells with full lsp access map("n", "ce", "FeMaco", { silent = true, desc = "edit code block" }) @@ -19,7 +23,7 @@ map("n", "cO", "O```python```k", { desc = "Insert quar map("n", "cp", "MarkdownPreviewToggle", { desc = "show md preview" }) -- create mindmaps directly from markdown! requires external executable -if (vim.fn.executable("markmap")) then - map("n", "cm", "MarkmapOpen", { desc = "open md mindmap" }) - map("n", "cM", "MarkmapWatch", { desc = "watch for md mindmap" }) +if vim.fn.executable("markmap") then + map("n", "cm", "MarkmapOpen", { desc = "open md mindmap" }) + map("n", "cM", "MarkmapWatch", { desc = "watch for md mindmap" }) end diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index e940094..f28ea72 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -87,6 +87,5 @@ "which-key.nvim": { "branch": "main", "commit": "ce741eb559c924d72e3a67d2189ad3771a231414" }, "wrapping.nvim": { "branch": "master", "commit": "5e87f1424c86c50d3bc205830aa56ed1cad45467" }, "zen-mode.nvim": { "branch": "main", "commit": "cb73b8bd0ef9d765b942db09dc762c603a89ae44" }, - "zettelkasten.nvim": { "branch": "main", "commit": "0e77624689b470410f5355b613d45219c9350264" }, "zk-nvim": { "branch": "main", "commit": "fb0962b75a680561f94cae0588b8da92ea8d2fae" } } \ No newline at end of file diff --git a/nvim/.config/nvim/lua/plugins/prose.lua b/nvim/.config/nvim/lua/plugins/prose.lua index 7bc7715..a5dcc7a 100644 --- a/nvim/.config/nvim/lua/plugins/prose.lua +++ b/nvim/.config/nvim/lua/plugins/prose.lua @@ -65,6 +65,11 @@ local prose_plugs = { prefix({ ["n"] = { name = "+notes" } }) prefix({ ["n"] = { name = "+note" } }) prefix({ ["n"] = { name = "+note", mode = "v" } }) + + require("zk.commands").add("ZkOrphans", function(opts) + opts = vim.tbl_extend("force", { orphan = true }, opts or {}) + require("zk").edit(opts, { title = "Zk Orphans" }) + end) end require("zk").setup({ picker = "telescope" }) end, @@ -82,67 +87,25 @@ local prose_plugs = { "ZkNewFromTitleSelection", "ZkNotes", "ZkTags", + "ZkOrphans", }, keys = { + { "ni", "edit ~/documents/notes/index.md", desc = "open index", silent = true }, { "nn", "ZkNotes { sort = { 'modified' } }", desc = "note list" }, { "nf", "ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }", desc = "note search", }, + { "nf", "ZkMatch", desc = "find note from selection", mode = "v" }, { "nt", "ZkTags", desc = "note tags" }, - { "nc", "ZkCd", desc = "notes directory" }, - { "nl", "ZkLinks", desc = "note links" }, - { "nb", "ZkLinks", desc = "note backlinks" }, + { "nc", "ZkCd", desc = "notedir cd" }, + { "no", "ZkNotes { sort = { 'modified' } }", desc = "orphans list" }, + { "nl", "ZkLinks", desc = "note links" }, + { "nb", "ZkBacklinks", desc = "note backlinks" }, { "nn", "ZkNew { title = vim.fn.input('Title: ') }", desc = "new note" }, - { "nn", ":ZkNewFromTitleSelection", desc = "title from selection", mode = "v" }, - { "nN", ":ZkNewFromContentSelection", desc = "content from selection", mode = "v" }, - { "nf", ":ZkMatch", desc = "find note from selection", mode = "v" }, - }, - }, - -- simple static markdown linking and link following using zettel IDs - { - "marty-oehme/zettelkasten.nvim", - dependencies = { - "mickael-menu/zk-nvim", -- for the CD when opening index - }, - ft = writing_ft, - keys = { - { - "", - function() - require("zettelkasten").link_follow() - end, - silent = true, - }, - { - "", - function() - require("zettelkasten").link_follow(true) - end, - mode = "v", - }, - { - "ni", - function() - require("zk.commands").get("ZkCd")() - require("zettelkasten").index_open() - end, - desc = "index page", - }, - { - "ni", - function() - require("zk.commands").get("ZkInsertLink")() - end, - desc = "insert link", - }, - { - "ni", - ":'<,'>ZkInsertLinkAtSelection", - mode = "v", - desc = "insert link", - }, + { "nn", "ZkNewFromTitleSelection", desc = "new note from selection", mode = "v" }, + { "nN", "ZkNewFromContentSelection", desc = "content from selection", mode = "v" }, }, },