From 083973e7c16910406a018e706832fa071c3ac6c4 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 17 Jul 2025 12:18:38 +0200 Subject: [PATCH 01/26] nvim: Improve markdown checkbox toggling Also given new mapping. Hit `` instead of ``. `` (in insert mode) instead now brings up the path completion which was previously on the other mapping. On any line in a markdown-like file (i.e. markdown, quarto, djot, etc.), we can hit `` in normal mode or insert mode to toggle the current line having a checkbox or not. It takes care to leave the current item a list item like it was if it already was filled with content. It does _not_ remove the list item even if it is empty, this may be an improvement for the future (i.e., empty line -> we hit -> line turns into `- [ ] ` -> we hit -> line stays `- `). But care should be taken to not remove a list item if we don't intend to, e.g. we could have toggled part of a list beforehand and don't want to remove the list on each toggle. That's why it is more conservative for now and I think it should work well enough (the case is likely to be rare in my mind). Also, while it does pick up the extended checkbox symbols ([o], [~], [-]), those are currently hardcoded into the query. In my mind it should pick those up dynamically from another plugin instead of hardcoding here, e.g. render-markdown which also defines the symbols? Lastly, we could extend it to use treesitter queries instead / on top if TS is found which would make it more robust than regex matching. But for an hour of hacking it works quite well. --- nvim/.config/nvim/after/ftplugin/markdown.lua | 28 +++++++++++++------ nvim/.config/nvim/lua/plugins/pickers.lua | 2 +- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/nvim/.config/nvim/after/ftplugin/markdown.lua b/nvim/.config/nvim/after/ftplugin/markdown.lua index c52ab63..4fee4ae 100644 --- a/nvim/.config/nvim/after/ftplugin/markdown.lua +++ b/nvim/.config/nvim/after/ftplugin/markdown.lua @@ -11,18 +11,28 @@ if require("core.util").is_available("which-key") then }) end --- add tasks w/ -map({ "i" }, "", function() - local line = vim.api.nvim_get_current_line() +-- Toggles existence of a md checkbox (`- [ ] `) on current line +-- Can be used on list lines, non-list lines or existing checkbox +local function toggle_checkbox() 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) + local line = vim.api.nvim_get_current_line() + local updated_line + -- look for existing checkbox + if line:find("^%s*[-*]%s%[[%sxo]%]") then + updated_line = line:gsub("^(%s*)([-*]?)%s*%[[%sxo-~]%]", "%1%2", 1) + -- look for existing list dash/asterisk + elseif line:find("^%s*[-*]%s") then + updated_line = line:gsub("^(%s*)([-*])%s*", "%1%2 [ ] ", 1) + -- add to non-list line + else + updated_line = line:gsub("^(%s*)", "%1- [ ] ", 1) + end 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) +end + +-- add tasks w/ +map({ "n", "i" }, "", toggle_checkbox) 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 }) diff --git a/nvim/.config/nvim/lua/plugins/pickers.lua b/nvim/.config/nvim/lua/plugins/pickers.lua index 98e2625..05db98c 100644 --- a/nvim/.config/nvim/lua/plugins/pickers.lua +++ b/nvim/.config/nvim/lua/plugins/pickers.lua @@ -191,7 +191,7 @@ return { -- file/item pickers and managers desc = "path complete", }, { - "", + "", function() require("fzf-lua").complete_path() end, From 782798488e44249b779af32a1d0b8e2ecb0a6a43 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 17 Jul 2025 15:55:46 +0200 Subject: [PATCH 02/26] nvim: Correctly concatenate prose filetypes Correctly append md_like and org_like into prose filetypes. And correctly load render_markdown for all md_like filetypes. NOTE: _Still_ does not work to render for djot on my end. Is it because of different TS queries? I am not sure. --- nvim/.config/nvim/lua/plugins/prose.lua | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/prose.lua b/nvim/.config/nvim/lua/plugins/prose.lua index 9a39ff9..2e57fac 100644 --- a/nvim/.config/nvim/lua/plugins/prose.lua +++ b/nvim/.config/nvim/lua/plugins/prose.lua @@ -1,8 +1,22 @@ +-- append t2 to t1 +-- happens in-place, so it CHANGES t1 +local function concat(t1, t2) + local tbl = {} + for i = 1, #t1 do + tbl[#tbl + 1] = t1[i] + end + for i = 1, #t2 do + tbl[#tbl + 1] = t2[i] + end + return tbl +end + local md_like = { "markdown", "djot", "pandoc", "quarto", + "rmd", "vimwiki", "codecompanion", } @@ -11,8 +25,6 @@ local org_like = { "org", } local prose_ft = { - unpack(md_like), - unpack(org_like), "asciidoc", "bib", "context", @@ -23,8 +35,9 @@ local prose_ft = { "tex", "text", "typst", - "rmd", } +prose_ft = concat(prose_ft, md_like) +prose_ft = concat(prose_ft, org_like) local prose_plugs = { -- UI improvements @@ -100,11 +113,11 @@ local prose_plugs = { }, }, }, - -- displays prettier md rendering { + -- displays prettier md rendering "MeanderingProgrammer/render-markdown.nvim", opts = { - file_types = { "markdown", "codecompanion" }, + file_types = md_like, render_modes = { "n", "c", "i" }, code = { sign = false, From 4222648ab0a6c356b3c2368f2ecfa1ec10906708 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 25 Jul 2025 10:13:25 +0200 Subject: [PATCH 03/26] qutebrowser: Add personal read-it-later as search engine Uses wallabag search which functions _extraordinarily_ badly, or I am not sure how the search syntax is yet. Best to only search for single words. --- qutebrowser/config/searchengines.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qutebrowser/config/searchengines.py b/qutebrowser/config/searchengines.py index c2a674e..ceedb6c 100644 --- a/qutebrowser/config/searchengines.py +++ b/qutebrowser/config/searchengines.py @@ -21,6 +21,7 @@ c.url.searchengines = { "pcw": "https://www.pcgamingwiki.com/w/index.php?search={}", "py": "https://pypi.org/search/?q={}", "r": "https://www.reddit.com/r/{}", + "read": "https://read.martyoeh.me/search?currentRoute=all&search_entry%5Bterm%5D={}", "sc": "https://www.shellcheck.net/wiki/SC{}", "sci": "https://sci-hub.ru/{}", "t": "https://www.thesaurus.com/browse/{}", From c381a0ffb699b2f8fe7f3d80117e81c7a6308e16 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 25 Jul 2025 10:13:25 +0200 Subject: [PATCH 04/26] task: Remove duplicate next report While taskwarrior itself can handle the duplication, it errors other programs like my taskopen python script. --- office/.config/task/taskrc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/office/.config/task/taskrc b/office/.config/task/taskrc index fa75be9..e729be0 100644 --- a/office/.config/task/taskrc +++ b/office/.config/task/taskrc @@ -34,9 +34,6 @@ active.indicator=> 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 @@ -113,4 +110,4 @@ report.issues.description=Git Issue Open or Closed state report.issues.columns=id,project,priority,due,gitbugstate,description,tags,scheduled report.issues.filter=( +PENDING or +WAITING ) and ( gitbugstate:OPEN ) -news.version=3.0.2 +news.version=3.4.1 From 7da85801b4d1d6bbaa654ac4ee37de812876e827 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 25 Jul 2025 10:21:47 +0200 Subject: [PATCH 05/26] nvim: Add more groq llm models to codecompanion --- nvim/.config/nvim/lua/plugins/llm.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nvim/.config/nvim/lua/plugins/llm.lua b/nvim/.config/nvim/lua/plugins/llm.lua index f2430f5..749f515 100644 --- a/nvim/.config/nvim/lua/plugins/llm.lua +++ b/nvim/.config/nvim/lua/plugins/llm.lua @@ -73,7 +73,11 @@ return { default = "llama-3.1-8b-instant", choices = { "llama-3.3-70b-versatile", + "moonshotai/kimi-k2-instruct", + "meta-llama/llama-guard-4-12b", "meta-llama/llama-4-maverick-17b-128e-instruct", + "meta-llama/llama-4-scout-17b-16e-instruct", + "deepseek-r1-distill-llama-70b", "mistral-saba-24b", }, }, From 6b40d1eadf5eaecfe515a981f27ab11fdf75bbba Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 14 Aug 2025 17:08:50 +0200 Subject: [PATCH 06/26] nvim: Create terraform language setup --- nvim/.config/nvim/lua/core/languages.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/core/languages.lua b/nvim/.config/nvim/lua/core/languages.lua index 62b5bd4..24fdaa3 100644 --- a/nvim/.config/nvim/lua/core/languages.lua +++ b/nvim/.config/nvim/lua/core/languages.lua @@ -117,6 +117,7 @@ local languages = { sh = { lint = { sh = { "shellcheck" } }, format = { sh = { "shellharden", "shfmt" } } }, sql = { format = { sql = { "sleek" } } }, svelte = { lint = { svelte = { "eslint_d" } }, format = { svelte = { "prettier" } } }, + terraform = { lint = { terraform = { "tflint" } }, lsp = { tofu_ls = {} }, format = { terraform = { "tofu_fmt" } } }, toml = { lsp = { taplo = {} }, ts = { "toml" } }, typescript = { lsp = { ts_ls = {} }, @@ -356,7 +357,6 @@ local languages = { "teal", "templ", "tera", - "terraform", "textproto", "thrift", "tiger", From 6b91ca2609730aeda15ff25e413ba3735ddc5b6a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 17 Aug 2025 13:08:24 +0200 Subject: [PATCH 07/26] nvim: Add sqruff sql linter --- nvim/.config/nvim/lua/core/languages.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/core/languages.lua b/nvim/.config/nvim/lua/core/languages.lua index 24fdaa3..ef8a674 100644 --- a/nvim/.config/nvim/lua/core/languages.lua +++ b/nvim/.config/nvim/lua/core/languages.lua @@ -115,7 +115,7 @@ local languages = { }, quarto = { lint = { quarto = { "markdownlint" } }, format = { quarto = { "prettier", "injected" } } }, sh = { lint = { sh = { "shellcheck" } }, format = { sh = { "shellharden", "shfmt" } } }, - sql = { format = { sql = { "sleek" } } }, + sql = { format = { sql = { "sleek" } }, lint = { sql = { "sqruff" } } }, svelte = { lint = { svelte = { "eslint_d" } }, format = { svelte = { "prettier" } } }, terraform = { lint = { terraform = { "tflint" } }, lsp = { tofu_ls = {} }, format = { terraform = { "tofu_fmt" } } }, toml = { lsp = { taplo = {} }, ts = { "toml" } }, From 47736f594174b34bdea22e7a311eb1e01487ece8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:36:28 +0200 Subject: [PATCH 08/26] kanshi: Add aliases to config --- desktop/.config/kanshi/config | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/desktop/.config/kanshi/config b/desktop/.config/kanshi/config index 1f5765e..347040d 100644 --- a/desktop/.config/kanshi/config +++ b/desktop/.config/kanshi/config @@ -1,20 +1,24 @@ + +output "LG Electronics W2442 0x000574E1" alias $left-screen +output "LG Electronics W2442 0x000574FD" alias $right-screen + profile docked { - output "LG Electronics W2442 0x000574FD" position 1920,0 - output "LG Electronics W2442 0x000574E1" position 0,0 + output $left-screen position 0,0 transform 0 + output $right-screen position 1920,0 transform 0 output eDP-1 disable exec notify-send "💻 Display changed" "Applying docked LG profile" } profile dockedall { - output "LG Electronics W2442 0x000574FD" position 1920,0 - output "LG Electronics W2442 0x000574E1" position 0,0 + output $left-screen position 0,0 + output $right-screen position 1920,0 output eDP-1 enable position 960,1080 exec notify-send "💻 Display changed" "Applying docked 3-screen profile" } profile portableforce { - output "LG Electronics W2442 0x000574FD" disable - output "LG Electronics W2442 0x000574E1" disable + output $left-screen disable + output $right-screen disable output eDP-1 enable position 0,0 exec notify-send "💻 Display changed" "Applying portable profile" } From 8005f034d1729f0b39ec6240317ce2a5bfd39d34 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:36:28 +0200 Subject: [PATCH 09/26] kanshi: Add vertical docked configuration --- desktop/.config/kanshi/config | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/desktop/.config/kanshi/config b/desktop/.config/kanshi/config index 347040d..14ad04f 100644 --- a/desktop/.config/kanshi/config +++ b/desktop/.config/kanshi/config @@ -2,6 +2,13 @@ output "LG Electronics W2442 0x000574E1" alias $left-screen output "LG Electronics W2442 0x000574FD" alias $right-screen +profile dockedvert { + output $left-screen position 0,0 transform 90 + output $right-screen position 1080,0 + output eDP-1 disable + exec notify-send "💻 Display changed" "Applying vertical docked LG profile" +} + profile docked { output $left-screen position 0,0 transform 0 output $right-screen position 1920,0 transform 0 From 44d76725cc043bf8a668c9f55361e080df029dc5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:38:45 +0200 Subject: [PATCH 10/26] kanshi: Change internal output position for dockedall --- desktop/.config/kanshi/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/.config/kanshi/config b/desktop/.config/kanshi/config index 14ad04f..fab1899 100644 --- a/desktop/.config/kanshi/config +++ b/desktop/.config/kanshi/config @@ -19,7 +19,7 @@ profile docked { profile dockedall { output $left-screen position 0,0 output $right-screen position 1920,0 - output eDP-1 enable position 960,1080 + output eDP-1 enable position 1080,1080 exec notify-send "💻 Display changed" "Applying docked 3-screen profile" } From d6ef9acb1cd199e81cb021c11e89d5d1f0d4e958 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:36:28 +0200 Subject: [PATCH 11/26] nvim: Start formatter on insertion mode In addition to just before writing a buffer, we load the formatter plugin when entering insertion mode. --- nvim/.config/nvim/lua/plugins/formatting.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins/formatting.lua b/nvim/.config/nvim/lua/plugins/formatting.lua index e91cfcd..df22393 100644 --- a/nvim/.config/nvim/lua/plugins/formatting.lua +++ b/nvim/.config/nvim/lua/plugins/formatting.lua @@ -82,7 +82,7 @@ return { end, }, }, - event = { "BufWritePre" }, + event = { "InsertEnter", "BufWritePre" }, opts = {}, }, } From ecf28787b6c7585f4d086b14a9aa642df9bd5560 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:36:28 +0200 Subject: [PATCH 12/26] qutebrowser: Add quoteinvestigator search engine as quote --- qutebrowser/config/searchengines.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qutebrowser/config/searchengines.py b/qutebrowser/config/searchengines.py index ceedb6c..67cbe61 100644 --- a/qutebrowser/config/searchengines.py +++ b/qutebrowser/config/searchengines.py @@ -20,6 +20,7 @@ c.url.searchengines = { "maps": "https://facilmap.org/#q={}", "pcw": "https://www.pcgamingwiki.com/w/index.php?search={}", "py": "https://pypi.org/search/?q={}", + "quote": "https://quoteinvestigator.com/?s={}", "r": "https://www.reddit.com/r/{}", "read": "https://read.martyoeh.me/search?currentRoute=all&search_entry%5Bterm%5D={}", "sc": "https://www.shellcheck.net/wiki/SC{}", From 1970dc9dbd9a2e743e97612f942e11af15c1f098 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:36:28 +0200 Subject: [PATCH 13/26] nvim: Remove terraform lint Linting is also done by the LSP so we double up our error messages. --- nvim/.config/nvim/lua/core/languages.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/core/languages.lua b/nvim/.config/nvim/lua/core/languages.lua index ef8a674..abad0d8 100644 --- a/nvim/.config/nvim/lua/core/languages.lua +++ b/nvim/.config/nvim/lua/core/languages.lua @@ -117,7 +117,10 @@ local languages = { sh = { lint = { sh = { "shellcheck" } }, format = { sh = { "shellharden", "shfmt" } } }, sql = { format = { sql = { "sleek" } }, lint = { sql = { "sqruff" } } }, svelte = { lint = { svelte = { "eslint_d" } }, format = { svelte = { "prettier" } } }, - terraform = { lint = { terraform = { "tflint" } }, lsp = { tofu_ls = {} }, format = { terraform = { "tofu_fmt" } } }, + terraform = { + lsp = { tofu_ls = {} }, + format = { terraform = { "terraform_fmt" } }, + }, toml = { lsp = { taplo = {} }, ts = { "toml" } }, typescript = { lsp = { ts_ls = {} }, From 590a0127829f3dc6515b1276b8274b672d9c11cb Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:39:11 +0200 Subject: [PATCH 14/26] nvim: Remove FIXME for fzf instant single selection We found the correct option and it does not instant-select single result search anymore. So we can remove the FIXME since it is indeed fixed. WIP: ZK workflow improvements --- nvim/.config/nvim/lua/plugins/pickers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins/pickers.lua b/nvim/.config/nvim/lua/plugins/pickers.lua index 05db98c..9f61afc 100644 --- a/nvim/.config/nvim/lua/plugins/pickers.lua +++ b/nvim/.config/nvim/lua/plugins/pickers.lua @@ -101,7 +101,7 @@ return { -- file/item pickers and managers }, }, }, - defaults = { -- FIXME: Does not seem to work with single result and still closes instantly? + defaults = { jump1 = false, }, }, From 34096cff746ce6d3d62b2080b59f80bbf2c2dfe7 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:44:09 +0200 Subject: [PATCH 15/26] zk: Fix default directory for zk notebook dir Use correct `$HOME` variable expansion instead of tilde. --- writing/zk/config/sh/env.d/zk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/writing/zk/config/sh/env.d/zk.sh b/writing/zk/config/sh/env.d/zk.sh index eb9ca6f..83c2c26 100644 --- a/writing/zk/config/sh/env.d/zk.sh +++ b/writing/zk/config/sh/env.d/zk.sh @@ -1,4 +1,4 @@ #!/usr/bin/env sh # -export ZK_NOTEBOOK_DIR="${WIKIROOT:-~/documents/notes/}" +export ZK_NOTEBOOK_DIR="${WIKIROOT:-$HOME/documents/notes/}" From 72f3e4877ca33c1679ab138ea47ce7bba1e42218 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:38:45 +0200 Subject: [PATCH 16/26] nvim: Default to wrapping in fzf-lua preview By default we wrap the contents. This will slightly worsen some coding previews, but greatly improve the default preview for text files. We will see if it makes sense to keep over time but this makes more sense to me right now -- especially with zk.nvim using fzf-lua as preview provider. --- nvim/.config/nvim/lua/plugins/pickers.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nvim/.config/nvim/lua/plugins/pickers.lua b/nvim/.config/nvim/lua/plugins/pickers.lua index 9f61afc..10ad16d 100644 --- a/nvim/.config/nvim/lua/plugins/pickers.lua +++ b/nvim/.config/nvim/lua/plugins/pickers.lua @@ -101,6 +101,11 @@ return { -- file/item pickers and managers }, }, }, + winopts = { + preview = { + wrap = true + } + }, defaults = { jump1 = false, }, From 0af5a2def56624e8f57a571b11c883e037a5f720 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:38:45 +0200 Subject: [PATCH 17/26] nvim: Default to textwidth of 100 for markdown files --- nvim/.config/nvim/after/ftplugin/markdown.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nvim/.config/nvim/after/ftplugin/markdown.lua b/nvim/.config/nvim/after/ftplugin/markdown.lua index 4fee4ae..b60d71e 100644 --- a/nvim/.config/nvim/after/ftplugin/markdown.lua +++ b/nvim/.config/nvim/after/ftplugin/markdown.lua @@ -4,6 +4,8 @@ vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 vim.opt.softtabstop = 2 +vim.opt.textwidth = 100 + if require("core.util").is_available("which-key") then require("which-key").add({ { "c", group = "codecells" }, From 943780c38beaf3f87f8a2a0f2e31f401e47dedc8 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:38:45 +0200 Subject: [PATCH 18/26] nvim: Fix fzf-lua jumps shortcut Was doubling up the `fr` shortcut which is actually to show registers. Now correctly mapped to `fj` (for jumps). --- nvim/.config/nvim/lua/plugins/pickers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins/pickers.lua b/nvim/.config/nvim/lua/plugins/pickers.lua index 10ad16d..b7786fc 100644 --- a/nvim/.config/nvim/lua/plugins/pickers.lua +++ b/nvim/.config/nvim/lua/plugins/pickers.lua @@ -269,7 +269,7 @@ return { -- file/item pickers and managers desc = "registers", }, { - "fr", + "fj", function() require("fzf-lua").jumps() end, From c436fe66fd0afadcfdb4cc8e106ef87f7cc390ed Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:38:45 +0200 Subject: [PATCH 19/26] nvim: Always determine correct wrapping for wiki text files For any files under my WIKIROOT directory I am sure that they are textual (if they fall into the wrapping.nvim allowlist). So we do not need to undertake the 'nontextual' file heuristic that uses the capabilities of the language server connected. Especially since our ZK lsp, or markdown lsp would always return the capability. Unfortunately wrapping.nvim does not currently have the ability to provide your own 'nontextual' heuristic, so I instead use a fork which does and provide the correct function in the options. --- nvim/.config/nvim/lazy-lock.json | 2 +- nvim/.config/nvim/lua/plugins/prose.lua | 37 +++++++++++++++++++++---- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 08406de..372427c 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -100,7 +100,7 @@ "vim-spellsync": { "branch": "master", "commit": "ea9f431483ceb40ede8bd5b126a03eccd49b1bc0" }, "wezterm.nvim": { "branch": "main", "commit": "f73bba23ab4becd146fa2d0a3a16a84b987eeaca" }, "which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" }, - "wrapping.nvim": { "branch": "master", "commit": "3a823200c297885b70515fa8d974e1763c578e26" }, + "wrapping.nvim": { "branch": "feat/nontextual-detection-option", "commit": "f3eb5d36e518b62430fd705086bc83cf2b1e7ac2" }, "zen-mode.nvim": { "branch": "main", "commit": "04b52674b8c800f8b7d4609e8bd8d0212e3ffa79" }, "zk-nvim": { "branch": "main", "commit": "fd1ab2239ed85ca51051c094a49a280f4ed76bb2" } } diff --git a/nvim/.config/nvim/lua/plugins/prose.lua b/nvim/.config/nvim/lua/plugins/prose.lua index 2e57fac..98a49b9 100644 --- a/nvim/.config/nvim/lua/plugins/prose.lua +++ b/nvim/.config/nvim/lua/plugins/prose.lua @@ -1,7 +1,7 @@ -- append t2 to t1 -- happens in-place, so it CHANGES t1 local function concat(t1, t2) - local tbl = {} + local tbl = {} for i = 1, #t1 do tbl[#tbl + 1] = t1[i] end @@ -85,14 +85,41 @@ local prose_plugs = { }, }, { - "andrewferrier/wrapping.nvim", + "marty-oehme/wrapping.nvim", + branch = "feat/nontextual-detection-option", opts = { create_keymaps = false, notify_on_switch = false, - -- softener = { quarto = true, markdown = true, text = true, asciidoc = true }, auto_set_mode_filetype_allowlist = prose_ft, + softener = { quarto = 2.0, markdown = 2.0, djot = 2.0 }, + nontextual_heuristic = function() + local nb = vim.tbl_get(vim.env, "ZK_NOTEBOOK_DIR") or vim.tbl_get(vim.env, "WIKIROOT") + if nb then + if vim.fn.expand("%:p:h"):find(nb) then + return false + end + return true + end + local get_clients + + if vim.fn.has("nvim-0.10") == 1 then + get_clients = vim.lsp.get_clients + else + get_clients = vim.lsp.get_active_clients + end + + for _, client in pairs(get_clients({ bufnr = 0 })) do + if + client.server_capabilities.definitionProvider + or client.server_capabilities.signatureHelpProvider + then + return true + end + end + + return false + end, }, - -- event = { "BufReadPre", "BufNewFile" }, ft = prose_ft, keys = { { @@ -114,7 +141,7 @@ local prose_plugs = { }, }, { - -- displays prettier md rendering + -- displays prettier md rendering "MeanderingProgrammer/render-markdown.nvim", opts = { file_types = md_like, From 246c06b60ba837be1db15abaeba41b739f26f813 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:38:45 +0200 Subject: [PATCH 20/26] nvim: Remove hard-coding to fzf-lua in zk-nvim picker --- nvim/.config/nvim/lua/plugins/prose.lua | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/prose.lua b/nvim/.config/nvim/lua/plugins/prose.lua index 98a49b9..248bbed 100644 --- a/nvim/.config/nvim/lua/plugins/prose.lua +++ b/nvim/.config/nvim/lua/plugins/prose.lua @@ -263,6 +263,13 @@ local prose_plugs = { end end, config = function() + local picker = "select" + if require("core.util").is_available("fzf-lua") then + picker = "fzf_lua" + elseif require("core.util").is_available("telescope") then + picker = "telescope" + end + require("zk.commands").add("ZkOrphans", function(opts) opts = vim.tbl_extend("force", { orphan = true }, opts or {}) require("zk").edit(opts, { title = "Zk Orphans" }) @@ -285,21 +292,17 @@ local prose_plugs = { return collection[path] end, }, opts or {}) - -- FIXME: Don't hard-code this so much? - -- require("telescope.builtin").live_grep(options) - require("fzf-lua").live_grep(options) + if picker == "telescope" then + require("telescope.builtin").live_grep(options) + elseif picker == "fzf_lua" then + require("fzf-lua").live_grep(options) + end end) - local picker = "select" - if require("core.util").is_available("fzf-lua") then - picker = "fzf_lua" - elseif require("core.util").is_available("telescope") then - picker = "telescope" - end require("zk").setup({ picker = picker, lsp = { config = { - filetypes = { "markdown", "quarto", "djot" }, + filetypes = md_like, }, auto_attach = { enabled = true, From 51336757cb97ad575f902f9c09d2cb8b9ce0c429 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 3 Sep 2025 11:31:43 +0200 Subject: [PATCH 21/26] nvim: Update codecompanion groq models --- nvim/.config/nvim/lua/plugins/llm.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/llm.lua b/nvim/.config/nvim/lua/plugins/llm.lua index 749f515..6fd15da 100644 --- a/nvim/.config/nvim/lua/plugins/llm.lua +++ b/nvim/.config/nvim/lua/plugins/llm.lua @@ -72,13 +72,18 @@ return { model = { default = "llama-3.1-8b-instant", choices = { + -- production models "llama-3.3-70b-versatile", + "llama-3.1-8b-instant", "moonshotai/kimi-k2-instruct", "meta-llama/llama-guard-4-12b", + "openai/gpt-oss-120b", + "openai/gpt-oss-20b", + -- preview models "meta-llama/llama-4-maverick-17b-128e-instruct", "meta-llama/llama-4-scout-17b-16e-instruct", "deepseek-r1-distill-llama-70b", - "mistral-saba-24b", + "qwen/qwen3-32b", }, }, }, @@ -130,6 +135,12 @@ return { { "ac", "CodeCompanionChat Toggle", desc = "Toggle chat", silent = true }, { "ac", "CodeCompanionChat Add", desc = "Add to chat", silent = true, mode = "v" }, }, - cmd = { "CodeCompanionActions", "CodeCompanionChat", "CodeCompanion", "CodeCompanionCmd" }, + cmd = { + "CodeCompanionActions", + "CodeCompanionChat", + "CodeCompanion", + "CodeCompanionCmd", + "CodeCompanionGitCommit", + }, }, } From 57a7149807c67ec5a6e78612663ccb393f653282 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:38:45 +0200 Subject: [PATCH 22/26] zk: Do not add new notes into inbox dir Inbox dir does not exist anymore, so we should not put new notes into it. --- writing/zk/config/sh/alias.d/zk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/writing/zk/config/sh/alias.d/zk.sh b/writing/zk/config/sh/alias.d/zk.sh index 845650f..67132d6 100644 --- a/writing/zk/config/sh/alias.d/zk.sh +++ b/writing/zk/config/sh/alias.d/zk.sh @@ -27,7 +27,7 @@ if [ -n "${WIKIROOT}" ]; then _zk_wiki new "$@" } nnn() { # 'new quicknote' - _zk_wiki new -t "${*:-$(date)}" inbox + _zk_wiki new -t "${*:-$(date)}" } nnl() { # 'new note log' _zk_wiki log "$@" From 9afb34fd2669b2ed8a6f64360c5848510d050563 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:38:45 +0200 Subject: [PATCH 23/26] nvim: Improve jj diff conflict resolution Currently invoked via `jj resolve --tool diffconflicts` --- nvim/.config/nvim/lazy-lock.json | 1 + nvim/.config/nvim/lua/plugins/git.lua | 18 +++++++++++++++--- vcs/jj/config/jj/config.toml | 11 +++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 372427c..10f302f 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -29,6 +29,7 @@ "hunk.nvim": { "branch": "master", "commit": "1e0a4d719c780bb8b0690a54915601508ced321e" }, "image.nvim": { "branch": "master", "commit": "a4638ec549c6aa56264cb0371255192ff37a8a90" }, "img-clip.nvim": { "branch": "main", "commit": "0bb8b5ced45c2672c70184c87d014194b0705815" }, + "jj-diffconflicts": { "branch": "feat/remove-instruction-message", "commit": "ee3f9179b2ab94d5177d3935fbf2bc94258d3541" }, "jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" }, "lazy-events.nvim": { "branch": "main", "commit": "63802b7ddc852bdfa29e33b158d52429276fa742" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, diff --git a/nvim/.config/nvim/lua/plugins/git.lua b/nvim/.config/nvim/lua/plugins/git.lua index f0b49fa..02b59c1 100644 --- a/nvim/.config/nvim/lua/plugins/git.lua +++ b/nvim/.config/nvim/lua/plugins/git.lua @@ -104,8 +104,20 @@ return { { "nvim-tree/nvim-web-devicons", optional = true }, }, cmd = { "DiffEditor" }, - config = function() - require("hunk").setup() - end, + -- config = function() + -- require("hunk").setup() + -- end, + opts = { + keys = { + global = { + quit = { "q" }, + }, + diff = { -- default to toggling line on both sides of diff with a + toggle_line = { "s" }, -- imagine it is '[s]ingle side' + toggle_line_pair = { "a" }, + }, + }, + }, }, + { "rafikdraoui/jj-diffconflicts", lazy = false }, } diff --git a/vcs/jj/config/jj/config.toml b/vcs/jj/config/jj/config.toml index 773e3e0..58b5e40 100644 --- a/vcs/jj/config/jj/config.toml +++ b/vcs/jj/config/jj/config.toml @@ -13,6 +13,17 @@ private-commits = "description(glob-i:'WIP:*') | description(glob-i:'PRIVATE:*') [ui] default-command = ["log", "-T", "builtin_log_oneline", "-r", "stack()"] diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"] +diff-instructions = false # don't add the JJ-INSTRUCTIONS file to diffs +merge-editor = "dc" + +[merge-tools.dc] # the 'diffconflicts' plugin for nvim +program = "nvim" +merge-args = [ + "-c", "let g:jj_diffconflicts_marker_length=$marker_length", + "-c", "let g:jj_diffconflicts_turn_off_instructions=1", + "-c", "JJDiffConflicts!", "$output", "$base", "$left", "$right" +] +merge-tool-edits-conflict-markers = true # use delta as formatter but _only_ for diff and show # see: https://github.com/jj-vcs/jj/discussions/4690#discussioncomment-12388965 From 5b15a20be759f37b7d3eaf863314c35b70c0057e Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:38:45 +0200 Subject: [PATCH 24/26] papis: Update library layout --- writing/papis/config/papis/config | 33 +++++++++++++------------------ 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/writing/papis/config/papis/config b/writing/papis/config/papis/config index 2852fab..c6d980d 100644 --- a/writing/papis/config/papis/config +++ b/writing/papis/config/papis/config @@ -8,6 +8,10 @@ picktool = papis-tui mark-opener-format = sioyek --page {mark[value]} file-browser = vifm +# use openl as isbn metadata provider. other options: goob, wiki +# see: https://isbnlib.readthedocs.io/en/latest/devs.html#api-s-main-namespaces under `meta` +isbn-service = openl + # edit info.yaml as new papers are added add-edit = True # ref-format = {doc[author_list][0][family]}{doc[year]} @@ -32,13 +36,17 @@ editmore = vi [main] dir = ~/documents/library -# My personal reading -[personal] -dir = ~/documents/library/personal +### Long-term libraries -# Sustainable supply chain logistics, especially procurement -[litrev-rahman] -dir = ~/documents/library/litrev-rahman +# General personal reading +[gen] +dir = ~/documents/library/general + +# General computer science reading +[cs] +dir = ~/documents/library/cs + +### Situational libraries # Addressing Inequalities in World of Work research [ilo] @@ -49,23 +57,10 @@ dir = ~/documents/library/ilo-wow [fedi] dir = ~/documents/library/fediverse -# General computer science reading -[cs] -dir = ~/documents/library/cs - -# Electrical engineering reading -[ee] -dir = ~/documents/library/ee - # All my university programme readings [emgs] dir = ~/documents/library/emgs -# General research reading -[academia] -dir = ~/documents/library/academia - - [plugins.extract] tags = {"red": "important", "green": "extra", "blue": "toread"} From cd414e528948485b07437d9d89d1077d21350cd5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 3 Sep 2025 11:47:15 +0200 Subject: [PATCH 25/26] nvim: Update codecompanion and options Needed to be changed to wrap adapter in http table after breaking config change. --- nvim/.config/nvim/lazy-lock.json | 6 +- nvim/.config/nvim/lua/plugins/llm.lua | 79 ++++++++++++++++----------- 2 files changed, 49 insertions(+), 36 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 10f302f..cf64526 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -8,9 +8,9 @@ "cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" }, "cmp-pandoc.nvim": { "branch": "main", "commit": "30faa4456a7643c4cb02d8fa18438fd484ed7602" }, "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, - "codecompanion-gitcommit.nvim": { "branch": "main", "commit": "0ea26d93321e259dbb3766bf7f845ff02284e220" }, - "codecompanion-history.nvim": { "branch": "main", "commit": "5442513f1303884079c8f13cf8b75da44a3db679" }, - "codecompanion.nvim": { "branch": "main", "commit": "7ae585e1c868edb523cbb15c49fd15bc3def1261" }, + "codecompanion-gitcommit.nvim": { "branch": "main", "commit": "e237b9901d64074fa84f74c1b20892303e3e1830" }, + "codecompanion-history.nvim": { "branch": "main", "commit": "b9f1afb77f1a8805e686f89ac38338a9ca588579" }, + "codecompanion.nvim": { "branch": "main", "commit": "76f1c1aaedbb159256dbc64705cd34f447046d64" }, "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, "copilot-lualine": { "branch": "main", "commit": "6bc29ba1fcf8f0f9ba1f0eacec2f178d9be49333" }, "copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" }, diff --git a/nvim/.config/nvim/lua/plugins/llm.lua b/nvim/.config/nvim/lua/plugins/llm.lua index 6fd15da..6ae7a70 100644 --- a/nvim/.config/nvim/lua/plugins/llm.lua +++ b/nvim/.config/nvim/lua/plugins/llm.lua @@ -58,43 +58,56 @@ return { opts = { strategies = { chat = { adapter = "groq" }, - inline = { adapter = "groq" }, + inline = { adapter = "copilot" }, + cmd = { adapter = "groq" }, }, adapters = { - groq = function() - return require("codecompanion.adapters").extend("openai", { - env = { - api_key = "GROQ_API_KEY", - }, - name = "Groq", - url = "https://api.groq.com/openai/v1/chat/completions", - schema = { - model = { - default = "llama-3.1-8b-instant", - choices = { - -- production models - "llama-3.3-70b-versatile", - "llama-3.1-8b-instant", - "moonshotai/kimi-k2-instruct", - "meta-llama/llama-guard-4-12b", - "openai/gpt-oss-120b", - "openai/gpt-oss-20b", - -- preview models - "meta-llama/llama-4-maverick-17b-128e-instruct", - "meta-llama/llama-4-scout-17b-16e-instruct", - "deepseek-r1-distill-llama-70b", - "qwen/qwen3-32b", + http = { + opts = { + show_defaults = false, -- TODO: set to false to only enable working, but does not show copilot then + }, + groq = function() + return require("codecompanion.adapters").extend("openai", { + env = { + api_key = "GROQ_API_KEY", + }, + name = "Groq", + url = "https://api.groq.com/openai/v1/chat/completions", + schema = { + model = { + default = "llama-3.1-8b-instant", + choices = { + -- production models + "llama-3.3-70b-versatile", + "llama-3.1-8b-instant", + "moonshotai/kimi-k2-instruct", + "meta-llama/llama-guard-4-12b", + "openai/gpt-oss-120b", + "openai/gpt-oss-20b", + -- preview models + "meta-llama/llama-4-maverick-17b-128e-instruct", + "meta-llama/llama-4-scout-17b-16e-instruct", + "deepseek-r1-distill-llama-70b", + "qwen/qwen3-32b", + }, }, }, - }, - max_tokens = { - default = 4096, - }, - temperature = { - default = 1, - }, - }) - end, + max_tokens = { + default = 4096, + }, + temperature = { + default = 1, + }, + }) + end, + gemini = function() + return require("codecompanion.adapters").extend("gemini", { + env = { + api_key = "GEMINI_API_KEY", + }, + }) + end, + }, }, display = { action_palette = { From 38127509803b4d9c75b139aad5c6cbe3f1e68d0c Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 3 Sep 2025 12:50:07 +0200 Subject: [PATCH 26/26] nvim: Add smartpaste to LLM prompts Will paste and try to integrate _anything_ into the curent buffer. Wrong programming language, no formatting, pseudo code, natural language instructions, anything. --- nvim/.config/nvim/lua/plugins/llm.lua | 72 +++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/nvim/.config/nvim/lua/plugins/llm.lua b/nvim/.config/nvim/lua/plugins/llm.lua index 6ae7a70..887cff6 100644 --- a/nvim/.config/nvim/lua/plugins/llm.lua +++ b/nvim/.config/nvim/lua/plugins/llm.lua @@ -142,6 +142,78 @@ return { }, }, }, + prompt_library = { + + ["Smart Paste"] = { + strategy = "inline", + description = "Paste code smartly", + opts = { short_name = "paste" }, + prompts = { + { + role = "user", + content = [[ +You are a smart code paste agent within Neovim. + +## **Task:** Intelligently integrate content from the user's clipboard into the current buffer. + +## **Instructions:** + +- You may receive code in various programming languages or even natural language instructions. +- If the clipboard content is in a different language than the current buffer, translate it to the appropriate language smartly. +- If the clipboard content contains pseudo code generate code accordingly. +- If the clipboard content contains natural language instructions, interpret and follow them to modify the code in the current buffer. +- **ONLY** generate the **new** lines of code required for seamless integration. +- Ensure the inserted code is syntactically correct and logically consistent with the existing code. +- Do **NOT** include surrounding code or line numbers. +- Make sure all brackets and quotes are closed properly. + +## **Output:** + +- Provide only the necessary lines of code for insertion. +- If you can't generate code just return nothing. +- Ensure the response is proper and well-formatted. + ]], + }, + { + role = "user", + content = function(context) + local lines = require("codecompanion.helpers.actions").get_code( + 1, + context.line_count, + { show_line_numbers = true } + ) + local selection_info = "" + local clipboard = vim.fn.getreg("+") + + if context.is_visual then + selection_info = string.format( + "Currently selected lines: %d-%d", + context.start_line, + context.end_line + ) + else + selection_info = string.format( + "Current cursor line: %d and Current cursor column is %d", + context.cursor_pos[1], + context.cursor_pos[2] + ) + end + + return string.format( + "I have the following code:\n\n```%s\n%s\n```\n\nClipboard content:\n\n```\n%s\n```\n\n%s", + context.filetype, + lines, + clipboard, + selection_info + ) + end, + opts = { + contains_code = true, + }, + }, + }, + }, + }, }, keys = { { "aa", "CodeCompanionActions", desc = "Actions", silent = true, mode = { "n", "v" } },