From dc1a02ebeb63afad39075ba44116e40421633eab Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 20 Feb 2025 15:37:25 +0100 Subject: [PATCH 01/15] jrnl: Move default location to be under notes --- writing/jrnl/config/jrnl/jrnl.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/writing/jrnl/config/jrnl/jrnl.yaml b/writing/jrnl/config/jrnl/jrnl.yaml index 14741d0..20dc11c 100644 --- a/writing/jrnl/config/jrnl/jrnl.yaml +++ b/writing/jrnl/config/jrnl/jrnl.yaml @@ -11,7 +11,7 @@ highlight: true indent_character: '|' journals: default: - journal: ~/documents/records/jrnl.md + journal: ~/documents/notes/journal/jrnl.md linewrap: 79 tagsymbols: + template: false From 86306afc08e06be99cfe1e076d4abf482b48c7b3 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 21 Feb 2025 16:58:52 +0100 Subject: [PATCH 02/15] qutebrowser: Manually redirect to FOSS genius frontends Since farside linking currently does not work we take the work into our own hands. --- qutebrowser/config/freedirect/freedirect.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/qutebrowser/config/freedirect/freedirect.py b/qutebrowser/config/freedirect/freedirect.py index b18e3f0..0b2999c 100644 --- a/qutebrowser/config/freedirect/freedirect.py +++ b/qutebrowser/config/freedirect/freedirect.py @@ -65,10 +65,22 @@ default_services = [ ), Service(source=["quora.com"], target=["quetre"]), Service(source=["google.com"], target=["whoogle"]), - Service(source=["genius.com"], target=["dumb"]), Service(source=["translate.google.com"], target=["lingva", "simplytranslate"]), Service(source=["deepl.com"], target=["simplytranslate"]), Service(source=["bandcamp.com"], target=["tent"]), + Service( + custom_targets=True, + source=["genius.com"], + target=[ + "dumb.privacydev.net", + "dumb.privacydev.net", + "dm.vern.cc", + "sing.whatever.social", + "dumb.nunosempere.com", + "dumb.lunar.icu", + "dumb.esmailelbob.xyz", + ], + ), Service( custom_targets=True, source=["pinterest.com"], From 612b92d1483445a5500e905bdf62c6791de10cd2 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 21 Feb 2025 17:01:16 +0100 Subject: [PATCH 03/15] jj: Make private commit matching case insensitive Whether you prefix your commit with 'WIP:' or 'wip:', 'private:' or 'PRIVATE:' it will be caught. --- vcs/jj/config/jj/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcs/jj/config/jj/config.toml b/vcs/jj/config/jj/config.toml index 174fd04..db6f968 100644 --- a/vcs/jj/config/jj/config.toml +++ b/vcs/jj/config/jj/config.toml @@ -9,7 +9,7 @@ key = "73BA40D5AFAF49C9" [git] sign-on-push = true subprocess = true -private-commits = "description(glob:'wip:*') | description(glob:'private:*')" # refuse to push WIP commits +private-commits = "description(glob-i:'WIP:*') | description(glob-i:'PRIVATE:*')" # refuse to push WIP commits [ui] diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"] From 66005a9948fc7cb8d5465a5a29c941a8dbe4f7fe Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 21 Feb 2025 17:01:16 +0100 Subject: [PATCH 04/15] jj: Switch manual commit splitting alias to use split Currently `ji` (for jj insert) does a 'manual' `jj split` by creating an empty commit underneath, squasing interactively and then moving back to the original. All of that is done by the existing `jj split` command. So we simply use it. I am keeping the `ji` alias for now, could still be 'jj insert' or 'jj spl(I)t' I suppose. --- vcs/jj/config/sh/alias.d/jj.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh index b6046b4..4c603c7 100644 --- a/vcs/jj/config/sh/alias.d/jj.sh +++ b/vcs/jj/config/sh/alias.d/jj.sh @@ -36,9 +36,8 @@ alias jsi="jj squash --interactive" # oops buttons alias ju="jj undo" -# for damn,-forgot-to-split-this-commit workflow -# Creates a new commit before with your selected changes, lets you describe it and carry on -alias ji="jj new -B@ --no-edit && jj squash --interactive && jj edit '@-' && jj describe && jj edit '@+'" +# allows you to split the current change into multiple +alias ji="jj split" # revset info alias jl="jj log -T builtin_log_oneline" From f9d0401132aac413da63e96ddca23f6ba731230e Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 11:00:12 +0100 Subject: [PATCH 05/15] jj: Mirror edit next with edit previous alias This new alias setup provides four quick traversal options: Moving ahead one commit (`jen` for edit next), backwards (`jep` for edit previous), as well as doing the same but creating new 'working copies' instead of going directly to a commit (`jenn` and `jepp`). --- vcs/jj/config/sh/alias.d/jj.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh index 4c603c7..ad55ec0 100644 --- a/vcs/jj/config/sh/alias.d/jj.sh +++ b/vcs/jj/config/sh/alias.d/jj.sh @@ -27,7 +27,10 @@ alias jd="jj diff" # for describe-and-edit workflows # https://steveklabnik.github.io/jujutsu-tutorial/real-world-workflows/the-edit-workflow.html alias je="jj edit" -alias jee="jj next --edit" +alias jen="jj next --edit" +alias jep="jj prev --edit" +alias jenn="jj next" +alias jepp="jj prev" # for squash-and-go workflows # https://steveklabnik.github.io/jujutsu-tutorial/real-world-workflows/the-squash-workflow.html From 98dca7ec04f5799c4619231b2c65bb0ddfaee2e2 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 11:00:12 +0100 Subject: [PATCH 06/15] jj: Extend log aliases The new log aliases follow one logic: small letters are default and capital letters show 'all' changes. Thus, `j` defaults to showing the simple log and `J` the same log but for all changes. `jl` shows oneline logs, `JL` oneline logs for all changes. `jlo` shows log summaries, `JLO` for all changes. And finally `jloo` and `JLOO` show the details patches for each change. --- vcs/jj/config/jj/config.toml | 1 + vcs/jj/config/sh/alias.d/jj.sh | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vcs/jj/config/jj/config.toml b/vcs/jj/config/jj/config.toml index db6f968..fefbb76 100644 --- a/vcs/jj/config/jj/config.toml +++ b/vcs/jj/config/jj/config.toml @@ -12,6 +12,7 @@ subprocess = true private-commits = "description(glob-i:'WIP:*') | description(glob-i:'PRIVATE:*')" # refuse to push WIP commits [ui] +default-command = "log" diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"] pager = "delta" diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh index ad55ec0..22a6dd5 100644 --- a/vcs/jj/config/sh/alias.d/jj.sh +++ b/vcs/jj/config/sh/alias.d/jj.sh @@ -43,11 +43,13 @@ alias ju="jj undo" alias ji="jj split" # revset info +alias J="jj log -r 'all()'" # mirror default command being log alias jl="jj log -T builtin_log_oneline" -alias jL="jj log -r 'all()'" +alias JL="jj log -T builtin_log_oneline -r 'all()'" alias jlo="jj log --summary" -alias jLO="jj log --summary -r 'all()'" +alias JLO="jj log --summary -r 'all()'" alias jloo="jj log --patch" +alias JLOO="jj log --patch -r 'all()'" alias jol="jj op log" jlf() { jj log -r "description($*)" From dc7bf66052a278b01d03581d26fa0bae86273749 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 11:00:12 +0100 Subject: [PATCH 07/15] jj: Add revset alias for current git head Adds a very simple 'githead' revset alias. This is not much simpler than directly invoking `git_head()` but it will remind me in the future of its existence. --- vcs/jj/config/jj/config.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/vcs/jj/config/jj/config.toml b/vcs/jj/config/jj/config.toml index fefbb76..520db74 100644 --- a/vcs/jj/config/jj/config.toml +++ b/vcs/jj/config/jj/config.toml @@ -40,3 +40,4 @@ log = "ancestors(@, 5) | ancestors(trunk()..(visible_heads() & mine()), 2) | tru "downstream(x,y)" = "(x::y) & y" "branches" = "downstream(trunk(), bookmarks()) & mine()" "curbranch" = "latest(branches::@- & branches)" +"githead" = "::git_head()" From 5a9be5479d681621eb25fbd84a5c51f6e919c540 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 11:07:46 +0100 Subject: [PATCH 08/15] jj: Add an alias to abandon a commit I have begun abandoning more commits recently, so this seems a good time to introduce an alias for it. It is not _so_ common as to require a 1 or 2-letter alias so we can go with the mnemonic `jab` for jj abandon. --- vcs/jj/config/sh/alias.d/jj.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh index 22a6dd5..df4f19f 100644 --- a/vcs/jj/config/sh/alias.d/jj.sh +++ b/vcs/jj/config/sh/alias.d/jj.sh @@ -41,6 +41,8 @@ alias jsi="jj squash --interactive" alias ju="jj undo" # allows you to split the current change into multiple alias ji="jj split" +# quickly get rid of a change +alias jab="jj abandon" # revset info alias J="jj log -r 'all()'" # mirror default command being log From 89737536ea6aa2f4260b77b0288f5de3c16af5b2 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 11:14:55 +0100 Subject: [PATCH 09/15] jj: Revert js to simple jj status alias I have gotten more used to using `jw` to 'show' the current changes in the working copy, and having `js` be _both_ status and show has become more confusing than helpful. For now, we just revert it to be a simple alias for the status command. --- vcs/jj/config/sh/alias.d/jj.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh index df4f19f..9bf1ff5 100644 --- a/vcs/jj/config/sh/alias.d/jj.sh +++ b/vcs/jj/config/sh/alias.d/jj.sh @@ -14,13 +14,7 @@ alias jds="jj describe" alias jc="jj commit" # finding out the current snapshot -js() { - if [ "$#" -eq 0 ]; then - jj status - else - jj show "$*" - fi -} +alias js="jj status" alias jw="jj show" alias jd="jj diff" From 5ab95c724f951a8b5c2dd2cd7b6a0b32e351d139 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 11:23:46 +0100 Subject: [PATCH 10/15] jj: Rework jj bookmark main alias Changed into a function which takes the revision to set the bookmark to as an argument. This should work without interfering much since the bookmark name that the `bookmark set` function _usually_ takes as argument is already given by the alias (always 'main') and thus we do not have to manually provide other arguments. It default to the current working copy just like the command and otherwise can point to any change. --- vcs/jj/config/sh/alias.d/jj.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh index 9bf1ff5..8e1c841 100644 --- a/vcs/jj/config/sh/alias.d/jj.sh +++ b/vcs/jj/config/sh/alias.d/jj.sh @@ -64,7 +64,9 @@ alias jrb="jj rebase" # 'branching' bookmark work alias jb="jj bookmark" -alias jbm="jj bookmark set main" +jbm() { + jj bookmark set -r "${1:-@}" main +} # remote work alias jrv="jj git remote list" From 44cd4481a2b4698ea0e6dfc88c855d760e6e088d Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 11:42:20 +0100 Subject: [PATCH 11/15] zk: Only create aliases if local wiki found Local wiki requires the '$WIKIROOT' env var to be set, pointing to the root of the (zk) wiki. So we only create associated aliases if the wiki actually exists on a machine. --- writing/zk/config/sh/alias.d/zk.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/writing/zk/config/sh/alias.d/zk.sh b/writing/zk/config/sh/alias.d/zk.sh index 998e0c3..fc7d73a 100644 --- a/writing/zk/config/sh/alias.d/zk.sh +++ b/writing/zk/config/sh/alias.d/zk.sh @@ -9,11 +9,14 @@ n() { fi } -# open notes with my vim zettelkasten plugin -# TODO better implementation conditional on zk.nvim & zettelkasten existing -# nvim +'lua pcall(require "zk.commands"') --headless +qa 2>&1 or similar to check - but slow -if command -v nvim >/dev/null 2>&1; then - alias ni='nvim +"lua require \"zk.commands\".get(\"ZkCd\")()" +"edit $WIKIROOT/index.md"' -fi +# We have a local wiki +if [ -n "${WIKIROOT}" ]; then + # open notes with my vim zettelkasten plugin + # TODO better implementation conditional on zk.nvim & zettelkasten existing + # nvim +'lua pcall(require "zk.commands"') --headless +qa 2>&1 or similar to check - but slow + if command -v nvim >/dev/null 2>&1; then + alias ni='nvim +"lua require \"zk.commands\".get(\"ZkCd\")()" +"edit $WIKIROOT/index.md"' + fi -alias ncd='pushd $WIKIROOT' + alias ncd='pushd $WIKIROOT' +fi From 613df985205a50d6cf8fc3f98783c4c6a7b88094 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 13:28:30 +0100 Subject: [PATCH 12/15] zk: Ensure global wiki cmds are always executed in wiki We use a custom zk indirection which ensures that any short alias for interacting with the zk wiki will actually act on the globally assigned wiki (by ensuring notebooks dir is "$WIKIROOT"). --- writing/zk/config/sh/alias.d/zk.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/writing/zk/config/sh/alias.d/zk.sh b/writing/zk/config/sh/alias.d/zk.sh index fc7d73a..dc506dd 100644 --- a/writing/zk/config/sh/alias.d/zk.sh +++ b/writing/zk/config/sh/alias.d/zk.sh @@ -1,14 +1,20 @@ #!/usr/bin/env sh # +_zk_wiki() { + zk --notebook-dir="$WIKIROOT" "$@" +} + n() { if [ $# -eq 0 ]; then - zk edit -i + _zk_wiki edit -i else - zk "${@}" + _zk_wiki "${@}" fi } + + # We have a local wiki if [ -n "${WIKIROOT}" ]; then # open notes with my vim zettelkasten plugin @@ -18,5 +24,11 @@ if [ -n "${WIKIROOT}" ]; then alias ni='nvim +"lua require \"zk.commands\".get(\"ZkCd\")()" +"edit $WIKIROOT/index.md"' fi - alias ncd='pushd $WIKIROOT' + alias ncd='cd $WIKIROOT' + nnd() { + _zk_wiki draft "$@" + } + nn() { + _zk_wiki new "$@" + } fi From 068fc77019bbba7a723b66fe8ea4e7393e462127 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 13:28:30 +0100 Subject: [PATCH 13/15] nvim: Only enable markdown mdeval mappings if available Check for the existence of the 'mdeval' plugin before setting the corresponding key mappings in markdown type files. --- nvim/.config/nvim/after/ftplugin/markdown.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/nvim/.config/nvim/after/ftplugin/markdown.lua b/nvim/.config/nvim/after/ftplugin/markdown.lua index 50d5511..ac9769d 100644 --- a/nvim/.config/nvim/after/ftplugin/markdown.lua +++ b/nvim/.config/nvim/after/ftplugin/markdown.lua @@ -11,12 +11,19 @@ if require("core.util").is_available("zk") and require("zk.util").notebook_root( map("n", "", "lua vim.lsp.buf.definition()", { silent = true }) end --- execute code cells -if vim.fn.mapcheck("cc") == "" then - map("n", "cc", require("mdeval").eval_code_block, { silent = true, desc = "evaluate code block" }) -end -if vim.fn.mapcheck("cx") == "" then - map("n", "cx", require("mdeval").eval_clean_results, { silent = true, desc = "clear code results" }) +if require("core.util").is_available("mdeval") then + -- execute code cells + if vim.fn.mapcheck("cc") == "" then + map("n", "cc", require("mdeval").eval_code_block, { silent = true, desc = "evaluate code block" }) + end + if vim.fn.mapcheck("cx") == "" then + map( + "n", + "cx", + require("mdeval").eval_clean_results, + { silent = true, desc = "clear code results" } + ) + end end -- jump to beginning of previous/ next cell code From 225641c1f0194dd66914296283520499c1c94403 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 16:23:57 +0100 Subject: [PATCH 14/15] zk: Create aliases for creating new note/draft/log --- writing/zk/config/sh/alias.d/zk.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/writing/zk/config/sh/alias.d/zk.sh b/writing/zk/config/sh/alias.d/zk.sh index dc506dd..344b589 100644 --- a/writing/zk/config/sh/alias.d/zk.sh +++ b/writing/zk/config/sh/alias.d/zk.sh @@ -13,8 +13,6 @@ n() { fi } - - # We have a local wiki if [ -n "${WIKIROOT}" ]; then # open notes with my vim zettelkasten plugin @@ -25,10 +23,13 @@ if [ -n "${WIKIROOT}" ]; then fi alias ncd='cd $WIKIROOT' - nnd() { - _zk_wiki draft "$@" - } - nn() { + nn() { # 'new note' _zk_wiki new "$@" } + nnl() { # 'new note log' + _zk_wiki log "$@" + } + nnd() { # 'new note draft' + _zk_wiki draft "$@" + } fi From 72eda6a992a6327dac7a83fb10d6d345831d3be6 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 16:23:57 +0100 Subject: [PATCH 15/15] vifm: Fix Makefile and yaml icons --- terminal/.config/vifm/favicons.vifm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/terminal/.config/vifm/favicons.vifm b/terminal/.config/vifm/favicons.vifm index e44f644..dc59c3d 100644 --- a/terminal/.config/vifm/favicons.vifm +++ b/terminal/.config/vifm/favicons.vifm @@ -6,7 +6,7 @@ " Specific directories set classify+=' :dir:/, :exe:, :reg:, :link:,? :?:, ::../::/, \  ::.git/::/, - \  ::.config/,,Makefile::/, + \  ::.config/::/, \  ::Desktop/::/, \  ::Documents/::/, \  ::Development/::/, @@ -24,7 +24,7 @@ set classify+=' :dir:/, :exe:, :reg:, :link:,? :?:, ::../:: \  ::node_modules/::/' " Specific files -set classify+=' ::.Xdefaults,,.Xresources,,.bashprofile,,.bash_profile,,.bashrc,,.dmrc,,.d_store,,.fasd,,.gitconfig,,.gitignore,,.jack-settings,,.mime.types,,.nvidia-settings-rc,,.pam_environment,,.profile,,.recently-used,,.selected_editor,,.xinitpurc,,.zprofile,,.yarnc,,.snclirc,,.tmux.conf,,.urlview,,.config,,.ini,,.user-dirs.dirs,,.mimeapps.list,,.offlineimaprc,,.msmtprc,,.Xauthority,,config::/, +set classify+=' ::.Xdefaults,,.Xresources,,.bashprofile,,.bash_profile,,.bashrc,,.dmrc,,.d_store,,.fasd,,.gitconfig,,.gitignore,,.jack-settings,,.mime.types,,.nvidia-settings-rc,,.pam_environment,,.profile,,.recently-used,,.selected_editor,,.xinitpurc,,.zprofile,,.yarnc,,.snclirc,,.tmux.conf,,.urlview,,.config,,.ini,,.user-dirs.dirs,,.mimeapps.list,,.offlineimaprc,,.msmtprc,,.Xauthority,,Makefile::, \  ::favicon.*,,README,,readme::, \  ::.vim,,.vimrc,,.gvimrc,,.vifm::, \  ::gruntfile.coffee,,gruntfile.js,,gruntfile.ls::, @@ -45,7 +45,7 @@ set classify+='λ ::*.ml,,*.mli::, \  ::*.bmp,,*.gif,,*.ico,,*.jpeg,,*.jpg,,*.png,,*.svg,,*.svgz,,*.tga,,*.tiff,,*.xmb,,*.xcf,,*.xpm,,*.xspf,,*.xwd,,*.cr2,,*.dng,,*.3fr,,*.ari,,*.arw,,*.bay,,*.crw,,*.cr3,,*.cap,,*.data,,*.dcs,,*.dcr,,*.drf,,*.eip,,*.erf,,*.fff,,*.gpr,,*.iiq,,*.k25,,*.kdc,,*.mdc,,*.mef,,*.mos,,*.mrw,,*.obm,,*.orf,,*.pef,,*.ptx,,*.pxn,,*.r3d,,*.raf,,*.raw,,*.rwl,,*.rw2,,*.rwz,,*.sr2,,*.srf,,*.srw,,*.tif,,*.x3f,,*.webp,,*.avif,,*.jxl::, \  ::*.ejs,,*.htm,,*.html,,*.slim,,*.xml::, \  ::*.mustasche::, - \  ::*.css,,*.less,,*.bat,,*.conf,,*.ini,,*.rc,,*.yml,,*.cfg::, + \  ::*.css,,*.less,,*.bat,,*.conf,,*.ini,,*.rc,,*.yml,,*.yaml,,*.cfg::, \  ::*.rss::, \  ::*.coffee::, \  ::*.twig::,