From 5679887739e35c409699e9f31f2f5ba251dfc296 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 25 Jun 2025 10:48:45 +0200 Subject: [PATCH 1/9] nvim: Remap diagnostic toggling --- nvim/.config/nvim/lua/plugins/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index 630179d..02bd0b1 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -158,7 +158,7 @@ vim.api.nvim_create_autocmd("LspAttach", { map("n", "lI", function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end, o({ desc = "Toggle inlay hints" })) - map("n", "lD", function() + map("n", "lE", function() vim.diagnostic.enable(not vim.diagnostic.is_enabled()) end, o({ desc = "Toggle Diagnostics" })) -- FIXME: Will be re-enabled with insert-mode autocmd above From 7f1064370bc3adcc47565295df884e2f37b3df64 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 15 Jul 2025 08:27:41 +0200 Subject: [PATCH 2/9] task: Only show annotation count in list view In 'next' view (my default) we list all annotations as normal with their full text. However, in 'list' view, we only show how many annotations are on a task (if any) and do not display their contents. This turns it into actually more of a list if there are many annotated tasks. --- office/.config/task/taskrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/office/.config/task/taskrc b/office/.config/task/taskrc index d6d8104..fa75be9 100644 --- a/office/.config/task/taskrc +++ b/office/.config/task/taskrc @@ -31,9 +31,12 @@ alias.o=exec topen active.indicator=> # customize list report: focus on due dates -report.list.columns=start.active,id,project,priority,due,description,tags,entry.age +report.list.columns=start.active,id,project,priority,due,description.count,tags,entry.age report.list.labels=,,Project,Pri,Due,Description,Tags,Age # customize next report: focus on urgencies +report.next.columns=id,project,priority,urgency,due,description.count,tags,scheduled,entry.age,recur +report.next.labels=,Project,Pri,Urg,Due,Description,Tags,Sched,Age,Recur +# customize next report: focus on urgencies report.next.columns=id,project,priority,urgency,due,description,tags,scheduled,entry.age,recur report.next.labels=,Project,Pri,Urg,Due,Description,Tags,Sched,Age,Recur From 6ceedae571917f50a75e9f613e1953b06a894e0e Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 16 Jul 2025 16:53:07 +0200 Subject: [PATCH 3/9] nvim: Add djot snippets Mostly copied from markdown, extended with single task and task list snippets. --- nvim/.config/nvim/snippets/djot.json | 425 +++++++++++++++++++++++++++ 1 file changed, 425 insertions(+) create mode 100644 nvim/.config/nvim/snippets/djot.json diff --git a/nvim/.config/nvim/snippets/djot.json b/nvim/.config/nvim/snippets/djot.json new file mode 100644 index 0000000..dd1c908 --- /dev/null +++ b/nvim/.config/nvim/snippets/djot.json @@ -0,0 +1,425 @@ +{ + "header 1": { + "prefix": "h1", + "body": ["# ${0}"], + "description": "Add header level 1" + }, + "header 2": { + "prefix": "h2", + "body": ["## ${0}"], + "description": "Add header level 2" + }, + "header 3": { + "prefix": "h3", + "body": ["### ${0}"], + "description": "Add header level 3" + }, + "header 4": { + "prefix": "h4", + "body": ["#### ${0}"], + "description": "Add header level 4" + }, + "header 5": { + "prefix": "h5", + "body": ["##### ${0}"], + "description": "Add header level 5" + }, + "header 6": { + "prefix": "h6", + "body": ["###### ${0}"], + "description": "Add header level 6" + }, + "Links": { + "prefix": ["l", "link"], + "body": ["[${1:text}](${2:url}) ${0}"], + "description": "Add links" + }, + "URLS": { + "prefix": ["u", "url"], + "body": ["<${1}> ${0}"], + "description": "Add urls" + }, + "Images": { + "prefix": "img", + "body": ["![${1:alt text}](${2:path}) ${0}"], + "description": "Add images" + }, + "Insert strikethrough": { + "prefix": "strikethrough", + "body": "~~${1}~~ ${0}", + "description": "Insert strikethrough" + }, + "Insert bold text": { + "prefix": ["bold", "b"], + "body": "**${1}** $0", + "description": "Insert bold text" + }, + "Insert italic text": { + "prefix": ["i", "italic"], + "body": "*${1}* $0", + "description": "Insert italic text" + }, + "Insert bold and italic text": { + "prefix": ["bold and italic", "bi"], + "body": "***${1}*** $0", + "description": "Insert bold and italic text" + }, + "Insert quoted text": { + "prefix": "quote", + "body": "> ${1}", + "description": "Insert quoted text" + }, + "Insert code": { + "prefix": "code", + "body": "`${1}` $0", + "description": "Insert code" + }, + "Insert code block": { + "prefix": "codeblock", + "body": ["```${1:language}", "$0", "```"], + "description": "Insert fenced code block" + }, + "Insert todo item": { + "prefix": "todo", + "body": ["- [ ] ${1:first}", "$0"], + "description": "Insert a single todo list item" + }, + "Insert todo list": { + "prefix": "todo list", + "body": ["- [ ] ${1:first}", "- [ ] ${2:second}", "- [ ] ${3:third}", "$0"], + "description": "Insert multiple todo list items" + }, + "Insert unordered list": { + "prefix": "unordered list", + "body": ["- ${1:first}", "- ${2:second}", "- ${3:third}", "$0"], + "description": "Insert unordered list" + }, + "Insert ordered list": { + "prefix": "ordered list", + "body": ["1. ${1:first}", "2. ${2:second}", "3. ${3:third}", "$0"], + "description": "Insert ordered list" + }, + "Insert horizontal rule": { + "prefix": "horizontal rule", + "body": "----------\n", + "description": "Insert horizontal rule" + }, + "Insert task list": { + "prefix": "task", + "body": ["- [${1| ,x|}] ${2:text}", "${0}"], + "description": "Insert task list" + }, + "Insert task list 2": { + "prefix": "task2", + "body": ["- [${1| ,x|}] ${2:text}", "- [${3| ,x|}] ${4:text}", "${0}"], + "description": "Insert task list with 2 tasks" + }, + "Insert task list 3": { + "prefix": "task3", + "body": [ + "- [${1| ,x|}] ${2:text}", + "- [${3| ,x|}] ${4:text}", + "- [${5| ,x|}] ${6:text}", + "${0}" + ], + "description": "Insert task list with 3 tasks" + }, + "Insert task list 4": { + "prefix": "task4", + "body": [ + "- [${1| ,x|}] ${2:text}", + "- [${3| ,x|}] ${4:text}", + "- [${5| ,x|}] ${6:text}", + "- [${7| ,x|}] ${8:text}", + "${0}" + ], + "description": "Insert task list with 4 tasks" + }, + "Insert task list 5": { + "prefix": "task5", + "body": [ + "- [${1| ,x|}] ${2:text}", + "- [${3| ,x|}] ${4:text}", + "- [${5| ,x|}] ${6:text}", + "- [${7| ,x|}] ${8:text}", + "- [${9| ,x|}] ${10:text}", + "${0}" + ], + "description": "Insert task list with 5 tasks" + }, + "Insert table": { + "prefix": "table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} |", + "| ------------- | -------------- | -------------- |", + "| ${4:Item1} | ${5:Item1} | ${6:Item1} |", + "${0}" + ], + "description": "Insert table with 2 rows and 3 columns. First row is heading." + }, + "Insert 2x1 table": { + "prefix": "2x1table", + "body": [ + "| ${1:Column1} |", + "| ------------- |", + "| ${2:Item1} |", + "${0}" + ], + "description": "Insert table with 2 rows and 1 column. First row is heading." + }, + "Insert 3x1 table": { + "prefix": "3x1table", + "body": [ + "| ${1:Column1} |", + "| ------------- |", + "| ${2:Item1} |", + "| ${3:Item2} |", + "${0}" + ], + "description": "Insert table with 3 rows and 1 column. First row is heading." + }, + "Insert 4x1 table": { + "prefix": "4x1table", + "body": [ + "| ${1:Column1} |", + "| ------------- |", + "| ${2:Item1} |", + "| ${3:Item2} |", + "| ${4:Item3} |", + "${0}" + ], + "description": "Insert table with 4 rows and 1 column. First row is heading." + }, + "Insert 5x1 table": { + "prefix": "5x1table", + "body": [ + "| ${1:Column1} |", + "| ------------- |", + "| ${2:Item1} |", + "| ${3:Item2} |", + "| ${4:Item3} |", + "| ${5:Item4} |", + "${0}" + ], + "description": "Insert table with 5 rows and 1 column. First row is heading." + }, + "Insert 2x2 table": { + "prefix": "2x2table", + "body": [ + "| ${1:Column1} | ${2:Column2} |", + "| -------------- | --------------- |", + "| ${3:Item1.1} | ${4:Item2.1} |", + "${0}" + ], + "description": "Insert table with 2 rows and 2 columns. First row is heading." + }, + "Insert 3x2 table": { + "prefix": "3x2table", + "body": [ + "| ${1:Column1} | ${2:Column2} |", + "| -------------- | --------------- |", + "| ${3:Item1.1} | ${4:Item2.1} |", + "| ${5:Item1.2} | ${6:Item2.2} |", + "${0}" + ], + "description": "Insert table with 3 rows and 2 columns. First row is heading." + }, + "Insert 4x2 table": { + "prefix": "4x2table", + "body": [ + "| ${1:Column1} | ${2:Column2} |", + "| -------------- | --------------- |", + "| ${3:Item1.1} | ${4:Item2.1} |", + "| ${5:Item1.2} | ${6:Item2.2} |", + "| ${7:Item1.3} | ${8:Item2.3} |", + "${0}" + ], + "description": "Insert table with 4 rows and 2 columns. First row is heading." + }, + "Insert 5x2 table": { + "prefix": "5x2table", + "body": [ + "| ${1:Column1} | ${2:Column2} |", + "|--------------- | --------------- |", + "| ${3:Item1.1} | ${4:Item2.1} |", + "| ${5:Item1.2} | ${6:Item2.2} |", + "| ${7:Item1.3} | ${8:Item2.3} |", + "| ${9:Item1.4} | ${10:Item2.4} |", + "${0}" + ], + "description": "Insert table with 5 rows and 2 columns. First row is heading." + }, + "Insert 2x3 table": { + "prefix": "2x3table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} |", + "| --------------- | --------------- | --------------- |", + "| ${4:Item1.1} | ${5:Item2.1} | ${6:Item3.1} |", + "${0}" + ], + "description": "Insert table with 2 rows and 3 columns. First row is heading." + }, + "Insert 3x3 table": { + "prefix": "3x3table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} |", + "| --------------- | --------------- | --------------- |", + "| ${4:Item1.1} | ${5:Item2.1} | ${6:Item3.1} |", + "| ${7:Item1.2} | ${8:Item2.2} | ${9:Item3.2} |", + "${0}" + ], + "description": "Insert table with 3 rows and 3 columns. First row is heading." + }, + "Insert 4x3 table": { + "prefix": "4x3table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} |", + "| --------------- | --------------- | --------------- |", + "| ${4:Item1.1} | ${5:Item2.1} | ${6:Item3.1} |", + "| ${7:Item1.2} | ${8:Item2.2} | ${9:Item3.2} |", + "| ${10:Item1.3} | ${11:Item2.3} | ${12:Item3.3} |", + "${0}" + ], + "description": "Insert table with 4 rows and 3 columns. First row is heading." + }, + "Insert 5x3 table": { + "prefix": "5x3table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} |", + "| --------------- | --------------- | --------------- |", + "| ${4:Item1.1} | ${5:Item2.1} | ${6:Item3.1} |", + "| ${7:Item1.2} | ${8:Item2.2} | ${9:Item3.2} |", + "| ${10:Item1.3} | ${11:Item2.3} | ${12:Item3.3} |", + "| ${13:Item1.4} | ${14:Item2.4} | ${15:Item3.4} |", + "${0}" + ], + "description": "Insert table with 5 rows and 3 columns. First row is heading." + }, + "Insert 2x4 table": { + "prefix": "2x4table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} |", + "| --------------- | --------------- | --------------- | --------------- |", + "| ${5:Item1.1} | ${6:Item2.1} | ${7:Item3.1} | ${8:Item4.1} |", + "${0}" + ], + "description": "Insert table with 2 rows and 4 columns. First row is heading." + }, + "Insert 3x4 table": { + "prefix": "3x4table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} |", + "| --------------- | --------------- | --------------- | --------------- |", + "| ${5:Item1.1} | ${6:Item2.1} | ${7:Item3.1} | ${8:Item4.1} |", + "| ${9:Item1.2} | ${10:Item2.2} | ${11:Item3.2} | ${12:Item4.2} |", + "${0}" + ], + "description": "Insert table with 3 rows and 4 columns. First row is heading." + }, + "Insert 4x4 table": { + "prefix": "4x4table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} |", + "| --------------- | --------------- | --------------- | --------------- |", + "| ${5:Item1.1} | ${6:Item2.1} | ${7:Item3.1} | ${8:Item4.1} |", + "| ${9:Item1.2} | ${10:Item2.2} | ${11:Item3.2} | ${12:Item4.2} |", + "| ${13:Item1.3} | ${14:Item2.3} | ${15:Item3.3} | ${16:Item4.3} |", + "${0}" + ], + "description": "Insert table with 4 rows and 4 columns. First row is heading." + }, + "Insert 5x4 table": { + "prefix": "5x4table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} |", + "| --------------- | --------------- | --------------- | --------------- |", + "| ${5:Item1.1} | ${6:Item2.1} | ${7:Item3.1} | ${8:Item4.1} |", + "| ${9:Item1.2} | ${10:Item2.2} | ${11:Item3.2} | ${12:Item4.2} |", + "| ${13:Item1.3} | ${14:Item2.3} | ${15:Item3.3} | ${16:Item4.3} |", + "| ${17:Item1.4} | ${18:Item2.4} | ${19:Item3.4} | ${20:Item4.4} |", + "${0}" + ], + "description": "Insert table with 5 rows and 4 columns. First row is heading." + }, + "Insert 2x5 table": { + "prefix": "2x5table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} | ${5:Column5} |", + "| --------------- | --------------- | --------------- | --------------- | --------------- |", + "| ${6:Item1.1} | ${7:Item2.1} | ${8:Item3.1} | ${9:Item4.1} | ${10:Item5.1} |", + "${0}" + ], + "description": "Insert table with 2 rows and 5 columns. First row is heading." + }, + "Insert 3x5 table": { + "prefix": "3x5table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} | ${5:Column5} |", + "| --------------- | --------------- | --------------- | --------------- | --------------- |", + "| ${6:Item1.1} | ${7:Item2.1} | ${8:Item3.1} | ${9:Item4.1} | ${10:Item5.1} |", + "| ${11:Item1.2} | ${12:Item2.2} | ${13:Item3.2} | ${14:Item4.2} | ${15:Item5.2} |", + "${0}" + ], + "description": "Insert table with 3 rows and 5 columns. First row is heading." + }, + "Insert 4x5 table": { + "prefix": "4x5table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} | ${5:Column5} |", + "| --------------- | --------------- | --------------- | --------------- | --------------- |", + "| ${6:Item1.1} | ${7:Item2.1} | ${8:Item3.1} | ${9:Item4.1} | ${10:Item5.1} |", + "| ${11:Item1.2} | ${12:Item2.2} | ${13:Item3.2} | ${14:Item4.2} | ${15:Item5.2} |", + "| ${16:Item1.3} | ${17:Item2.3} | ${18:Item3.3} | ${19:Item4.3} | ${20:Item5.3} |", + "${0}" + ], + "description": "Insert table with 4 rows and 5 columns. First row is heading." + }, + "Insert 5x5 table": { + "prefix": "5x5table", + "body": [ + "| ${1:Column1} | ${2:Column2} | ${3:Column3} | ${4:Column4} | ${5:Column5} |", + "| --------------- | --------------- | --------------- | --------------- | --------------- |", + "| ${6:Item1.1} | ${7:Item2.1} | ${8:Item3.1} | ${9:Item4.1} | ${10:Item5.1} |", + "| ${11:Item1.2} | ${12:Item2.2} | ${13:Item3.2} | ${14:Item4.2} | ${15:Item5.2} |", + "| ${16:Item1.3} | ${17:Item2.3} | ${18:Item3.3} | ${19:Item4.3} | ${20:Item5.3} |", + "| ${21:Item1.4} | ${22:Item2.4} | ${23:Item3.4} | ${24:Item4.4} | ${25:Item5.4} |", + "${0}" + ], + "description": "Insert table with 5 rows and 5 columns. First row is heading." + }, + "Insert subscript": { + "prefix": "sub", + "body": ["${1}${0}"], + "description": "Create a subscript." + }, + "Insert superscript": { + "prefix": "sup", + "body": ["${1}${0}"], + "description": "Create a superscript." + }, + "Insert Note": { + "prefix": ["note", "n"], + "body": "> [!NOTE]\n> ", + "description": "Insert Note" + }, + "Insert Tip": { + "prefix": ["tip", "t"], + "body": "> [!TIP]\n> ", + "description": "Insert Tip" + }, + "Insert Important": { + "prefix": ["important", "imp"], + "body": "> [!IMPORTANT]\n> ", + "description": "Insert Important" + }, + "Insert Warning": { + "prefix": ["warning", "w"], + "body": "> [!WARNING]\n> ", + "description": "Insert Warning" + }, + "Insert Caution": { + "prefix": ["caution", "c"], + "body": "> [!CAUTION]\n> ", + "description": "Insert Caution" + } +} From aade4456e36776812de9c29e162e1a26d798d84c Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 16 Jul 2025 16:53:07 +0200 Subject: [PATCH 4/9] nvim: Add todo snippets to markdown Taken from djot snippets to allow adding a single task and multiple tasks. --- nvim/.config/nvim/snippets/markdown.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nvim/.config/nvim/snippets/markdown.json b/nvim/.config/nvim/snippets/markdown.json index 091f390..2199f7e 100644 --- a/nvim/.config/nvim/snippets/markdown.json +++ b/nvim/.config/nvim/snippets/markdown.json @@ -23,5 +23,15 @@ "prefix": "blogfront", "body": ["---", "title: ${1:title}", "description: ${2: desc}", "pubDate: ${3:date}", "tags: ${4:tags}", "${0}", "---"], "description": "add frontmatter" + }, + "Insert todo item": { + "prefix": "todo", + "body": ["- [ ] ${1:first}", "$0"], + "description": "Insert a single todo list item" + }, + "Insert todo list": { + "prefix": "todo list", + "body": ["- [ ] ${1:first}", "- [ ] ${2:second}", "- [ ] ${3:third}", "$0"], + "description": "Insert multiple todo list items" } } From fb94651f4c6c68fa160b243f233b226618b76ccd Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 16 Jul 2025 16:53:07 +0200 Subject: [PATCH 5/9] nvim: Add markdown todo augend toggle Use and to cycle through all todo list item states. Only works if the cursor is directly on the todo list item. --- nvim/.config/nvim/lua/plugins/editing.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nvim/.config/nvim/lua/plugins/editing.lua b/nvim/.config/nvim/lua/plugins/editing.lua index cf1d246..2c37409 100644 --- a/nvim/.config/nvim/lua/plugins/editing.lua +++ b/nvim/.config/nvim/lua/plugins/editing.lua @@ -36,6 +36,11 @@ return { word = false, cyclic = true, }), + augend.constant.new({ + elements = { "- [ ] ", "- [x] ", "- [o] ", "- [-] ", "- [~] " }, + word = false, + cyclic = true, + }), }, }) end, From 02ae47781ae68bf597d0fa2fb8464093f1ad1a4a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 16 Jul 2025 17:25:05 +0200 Subject: [PATCH 6/9] nvim: Add rendermarkdown todo completion source Could be optionally set for 'blink' but since blink.cmp also displays lsp results this is more general (and, currently, the recommended way). Suggests task states if doing a single '-' dash at an appropriate place. --- nvim/.config/nvim/lua/plugins/prose.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nvim/.config/nvim/lua/plugins/prose.lua b/nvim/.config/nvim/lua/plugins/prose.lua index e6f32bc..6166751 100644 --- a/nvim/.config/nvim/lua/plugins/prose.lua +++ b/nvim/.config/nvim/lua/plugins/prose.lua @@ -106,6 +106,9 @@ local prose_plugs = { conceal = false, }, }, + completions = { + lsp = { enabled = true }, + }, }, dependencies = { "nvim-treesitter/nvim-treesitter", From 27ef79391c081091785052eb4f3409b94dff89a6 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 16 Jul 2025 17:34:49 +0200 Subject: [PATCH 7/9] docs: Remove senseless line from README --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a9c852a..cbfc874 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,6 @@ Enjoy! ## Notes -- This are a good sign. - Generally, most configuration for applications attempts to follow the XDG specifications, keeping configuration in .config directory and supplementary files in .local/share directory. Over time, I am moving more applications to this standard: it keeps the home directory clean, and the separation of configuration, binaries, and data relatively clear. - The `zsh` directory contains all setup for the z-shell, my daily work environment. It should not be required for working with any other module but will add additional functionality to many (such as command auto-completion and so on). `sh` sets some base functionality for any shell you may wish to work in. It is, for now, the only module that is required for some other modules to work.[^shreq] - `rofi` contains additional scripts and a simple theming framework for rofi and should probably be reorganized to put the correct files into the correct directories (per xdg) at some point. From c26ef032d2cde43c83396f4d314b5ede669a7dd8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 16 Jul 2025 17:34:49 +0200 Subject: [PATCH 8/9] nvim: Add mapping to insert todo item into markdown Use when in insert mode and it will prepend the line with an empty todo item. --- nvim/.config/nvim/after/ftplugin/markdown.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nvim/.config/nvim/after/ftplugin/markdown.lua b/nvim/.config/nvim/after/ftplugin/markdown.lua index acdb2f3..c52ab63 100644 --- a/nvim/.config/nvim/after/ftplugin/markdown.lua +++ b/nvim/.config/nvim/after/ftplugin/markdown.lua @@ -11,6 +11,19 @@ if require("core.util").is_available("which-key") then }) end +-- add tasks w/ +map({ "i" }, "", function() + local line = vim.api.nvim_get_current_line() + local cursor = vim.api.nvim_win_get_cursor(0) + -- remove existing prefixes if any + -- TODO: Improved matching for e.g. '- [ ]' already on line, or indented '-' + -- and add task on line below if line is already populated + local updated_line = line:gsub("^%s*[-*]%s*", "", 1) + vim.api.nvim_set_current_line(updated_line) + vim.api.nvim_win_set_cursor(0, { cursor[1], #updated_line }) + vim.api.nvim_put({ "- [ ] " }, "c", true, true) +end) + if require("core.util").is_available("zk") and require("zk.util").notebook_root(vim.fn.expand("%:p")) ~= nil then map("n", "", "lua vim.lsp.buf.definition()", { silent = true }) end From be9b5b9297e16628332d62b2f1758deb018cd8d0 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 16 Jul 2025 17:52:24 +0200 Subject: [PATCH 9/9] nvim: Use markdown ftplugin for djot as well Simply import the markdown settings. We have to make use of the vim cmd runtime (suggested here: https://reddit.com/r/neovim/comments/ykpnob/require_one_ftpluginftlua_into_another/) since lua requires cannot (afaik) exit the lua folder in the config directory. --- nvim/.config/nvim/after/ftplugin/djot.lua | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 nvim/.config/nvim/after/ftplugin/djot.lua diff --git a/nvim/.config/nvim/after/ftplugin/djot.lua b/nvim/.config/nvim/after/ftplugin/djot.lua new file mode 100644 index 0000000..8bdca83 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/djot.lua @@ -0,0 +1,2 @@ +-- just copy markdown settings +vim.cmd.runtime({"after/ftplugin/markdown.lua", bang=true})