From 4bea6507c048724b33cbe4cf5d82885393d4b6f1 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 15 Nov 2025 09:26:23 +0100 Subject: [PATCH 1/8] wezterm: Add key to detach selected pane into new window `` activates the pane selector and lets you decide which pane to detach from the current _window_ and move to a new one. This mirrors the `` mapping moving a pane to a new tab, only 'bigger', thus using shift in addition. The binding is a little awkward, but with how rarely I have needed to use it this was fine for me so far. --- terminal/.config/wezterm/maps.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/terminal/.config/wezterm/maps.lua b/terminal/.config/wezterm/maps.lua index 40cc692..c26a873 100644 --- a/terminal/.config/wezterm/maps.lua +++ b/terminal/.config/wezterm/maps.lua @@ -52,6 +52,11 @@ local keys = { mods = "LEADER|CTRL", action = act.PaneSelect({ mode = "MoveToNewTab" }), }, + { + key = "Q", + mods = "LEADER|CTRL", + action = act.PaneSelect({ mode = "MoveToNewWindow" }), + }, { key = "R", mods = "LEADER", From 054cbd9ff54317586cebea06c5b34066efde2426 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 26 Nov 2025 18:37:10 +0100 Subject: [PATCH 2/8] nvim: Update codecompanion plugin --- nvim/.config/nvim/lazy-lock.json | 5 ++--- nvim/.config/nvim/lua/modules/llm.lua | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 06ee9ad..cfaf11b 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -9,9 +9,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": "e237b9901d64074fa84f74c1b20892303e3e1830" }, + "codecompanion-gitcommit.nvim": { "branch": "main", "commit": "26faf186d795a0d651fcd42f677c706d1b071dda" }, "codecompanion-history.nvim": { "branch": "main", "commit": "eb99d256352144cf3b6a1c45608ec25544a0813d" }, - "codecompanion.nvim": { "branch": "main", "commit": "4bc03c40b8f7f5e5d3c324479a893c6589471446" }, + "codecompanion.nvim": { "branch": "main", "commit": "e7762c68daf24c3e356401f5223eeb5217047754" }, "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, "copilot-lualine": { "branch": "main", "commit": "6bc29ba1fcf8f0f9ba1f0eacec2f178d9be49333" }, "copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" }, @@ -93,7 +93,6 @@ "stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" }, "texpresso.vim": { "branch": "main", "commit": "907838c08bbf99ad6bed3c908f1d0551a92ab4e0" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, - "tree-sitter-nu": { "branch": "main", "commit": "b64f0d1c93a76d167fabb01271905f0d18c5f10c" }, "trouble.nvim": { "branch": "main", "commit": "748ca2789044607f19786b1d837044544c55e80a" }, "twilight.nvim": { "branch": "main", "commit": "8bb7fa7b918baab1ca81b977102ddb54afa63512" }, "typst-preview.nvim": { "branch": "master", "commit": "dea4525d5420b7c32eebda7de15a6beb9d6574fa" }, diff --git a/nvim/.config/nvim/lua/modules/llm.lua b/nvim/.config/nvim/lua/modules/llm.lua index f02f5e6..292a4ac 100644 --- a/nvim/.config/nvim/lua/modules/llm.lua +++ b/nvim/.config/nvim/lua/modules/llm.lua @@ -134,14 +134,14 @@ return { url = "https://api.groq.com/openai/v1/chat/completions", schema = { model = { - default = "llama-3.1-8b-instant", + default = "moonshotai/kimi-k2-instruct-0905", choices = { -- production models + "openai/gpt-oss-120b", + "moonshotai/kimi-k2-instruct-0905", "llama-3.3-70b-versatile", "llama-3.1-8b-instant", - "moonshotai/kimi-k2-instruct-0905", "meta-llama/llama-guard-4-12b", - "openai/gpt-oss-120b", "openai/gpt-oss-20b", -- preview models "meta-llama/llama-4-maverick-17b-128e-instruct", From 63c4952118aff52c17524aa6fbcaff4556b3b141 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 26 Nov 2025 18:37:10 +0100 Subject: [PATCH 3/8] nvim: Add prompts to codecompanion plugin --- nvim/.config/nvim/lua/modules/llm.lua | 41 +++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lua/modules/llm.lua b/nvim/.config/nvim/lua/modules/llm.lua index 292a4ac..0b7dc30 100644 --- a/nvim/.config/nvim/lua/modules/llm.lua +++ b/nvim/.config/nvim/lua/modules/llm.lua @@ -195,12 +195,49 @@ return { callback = "mcphub.extensions.codecompanion", opts = { show_results_in_chat = true, - make_vars = true, - make_slash_commands = true, + make_tools = true, -- Make individual tools (@server__tool) and server groups (@server) from MCP servers + make_vars = true, -- Make individual resources into #variables + make_slash_commands = true, -- Make individual prompts into /slash commands + show_server_tools_in_chat = true, -- Show individual tools in chat completion (when make_tools=true) + add_mcp_prefix_to_tool_names = false, -- Add mcp__ prefix (e.g `@mcp__github`, `@mcp__neovim__list_issues`) + show_result_in_chat = true, -- Show tool results directly in chat buffer }, }, }, prompt_library = { + ["DevOps strategy"] = { + strategy = "chat", + description = "Senior devops engineer explains high-level solutions.", + opts = { short_name = "devops" }, + prompts = { + { + role = "system", + content = "You are a Senior DevOps engineer working at a professional company. Your role is to provide scalable, efficient, and automated solutions for software deployment, infrastructure management, and CI/CD pipelines. First problem is: Creating an MVP quickly, suggest the best DevOps practices, including infrastructure setup, deployment strategies, automation tools, and cost-effective scaling solutions. Reply in English using professional tone for everyone.", + }, + }, + }, + ["Code Reviewer Chat"] = { + strategy = "chat", + description = "Get your code reviewed by an 'experienced' developer.", + opts = { short_name = "review" }, + prompts = { + { + role = "system", + content = "I want you to act as a Code reviewer who is experienced developer in the given code language. I will provide you with the code block or methods or code file along with the code language name, and I would like you to review the code and share the feedback, suggestions and alternative recommended approaches. Please write explanations behind the feedback or suggestions or alternative approaches.", + }, + }, + }, + ["HackerNews Review"] = { + strategy = "chat", + description = "Get your code reviewed by a jaded hackernews commenter.", + opts = { short_name = "hackernews" }, + prompts = { + { + role = "system", + content = "I want you to act as a Code reviewer who is experienced developer in the given code language. I will provide you with the code block or methods or code file along with the code language name, and I would like you to review the code and share the feedback, suggestions and alternative recommended approaches as if you had read it on hackernews. Please be concise and do not give extraneous positives unless they truly are warranted. Provide explanations behind the feedback or suggestions or alternative approaches, in the succinct manner of hackernews comments.", + }, + }, + }, ["Smart Paste"] = { strategy = "inline", description = "Paste code smartly", From e63681c16b61956b0a57768e56b30890677f6fd0 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 26 Nov 2025 18:37:10 +0100 Subject: [PATCH 4/8] nvim: Use snacks.nvim for zenmode and papis if available Remove dependency on 'twilight.nvim' and make dependencies on 'snacks.nvim' optional, but load it in the base plugins. --- nvim/.config/nvim/lua/modules/base.lua | 1 + nvim/.config/nvim/lua/modules/prose.lua | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/modules/base.lua b/nvim/.config/nvim/lua/modules/base.lua index cc70347..57bd8fc 100644 --- a/nvim/.config/nvim/lua/modules/base.lua +++ b/nvim/.config/nvim/lua/modules/base.lua @@ -381,6 +381,7 @@ return { }, }, }, + { "folke/snacks.nvim", lazy = false, opts = {} }, -- try to avoid putting files in util buffers, e.g. filetree, aerial, undotree, .. { "stevearc/stickybuf.nvim", config = true }, -- make it a little less painful to open really big (>2mb) files by disabling features diff --git a/nvim/.config/nvim/lua/modules/prose.lua b/nvim/.config/nvim/lua/modules/prose.lua index ed4e512..eef7e48 100644 --- a/nvim/.config/nvim/lua/modules/prose.lua +++ b/nvim/.config/nvim/lua/modules/prose.lua @@ -47,12 +47,18 @@ local prose_plugs = { "folke/zen-mode.nvim", config = true, cmd = { "ZenMode" }, - dependencies = { "folke/twilight.nvim", { "arnamak/stay-centered.nvim", opts = { enabled = false } } }, + dependencies = { + { "folke/snacks.nvim", optional = true, opts = { dim = { enabled = true } } }, + { "arnamak/stay-centered.nvim", opts = { enabled = false } }, + }, keys = { { "[sz", function() require("zen-mode").close() + if require("core.util").is_available("snacks") then + Snacks.dim.disable() + end require("stay-centered").disable() end, silent = true, @@ -62,6 +68,9 @@ local prose_plugs = { "]sz", function() require("zen-mode").open() + if require("core.util").is_available("snacks") then + Snacks.dim.enable() + end require("stay-centered").enable() end, silent = true, From 04fc9b8017e3402786385e56106a8d5469276b70 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 26 Nov 2025 18:37:10 +0100 Subject: [PATCH 5/8] nvim: Add optional snacks.nvim dependency for updated molten-nvim Since the molten-nvim plugin supports setting `snacks.nvim` as `molten_image_provider`, we add it as optional dependency. It is _not_ enabled yet however, have to figure out how to accomplish this from the embedded optional spec, and also fix molten-nvim before adding more stuff to it. --- nvim/.config/nvim/lazy-lock.json | 2 +- nvim/.config/nvim/lua/modules/data_analysis.lua | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index cfaf11b..bc7864b 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -53,7 +53,7 @@ "mini.files": { "branch": "main", "commit": "49c855977e9f4821d1ed8179ed44fe098b93ea2a" }, "mini.nvim": { "branch": "main", "commit": "94cae4660a8b2d95dbbd56e1fbc6fcfa2716d152" }, "mini.starter": { "branch": "main", "commit": "d8038690eadf203a40863c3a9423df880a901d39" }, - "molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" }, + "molten-nvim": { "branch": "main", "commit": "4fd7be6a12b5efda5179db642f13bad60893acca" }, "neo-tree-jj.nvim": { "branch": "main", "commit": "c6534930c6f79893e12eafbb722ee23e6a83e80e" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, "neogen": { "branch": "main", "commit": "b2e78708876f4da507839726816010a68e33fec8" }, diff --git a/nvim/.config/nvim/lua/modules/data_analysis.lua b/nvim/.config/nvim/lua/modules/data_analysis.lua index 071ae15..6446777 100644 --- a/nvim/.config/nvim/lua/modules/data_analysis.lua +++ b/nvim/.config/nvim/lua/modules/data_analysis.lua @@ -108,8 +108,16 @@ return { -- REPL work { "benlubas/molten-nvim", + version = false, dependencies = { { "willothy/wezterm.nvim", config = true }, + { + "folke/snacks.nvim", + optional = true, + opts = { image = { enabled = true } }, + cond = vim.fn.executable("magick") == 1, -- only runs if ImageMagick installed + -- FIXME: how to correctly set 'molten_image_provider' after loading? + }, -- preferred image display { "image.nvim", optional = true }, }, build = ":UpdateRemotePlugins", From dc8030f9054bc17e2dd53c0496d638ca2a276bd5 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 29 Nov 2025 15:58:51 +0100 Subject: [PATCH 6/8] nvim: Use snacks zen mode Update to solely use snacks zen mode, removing both twilight and zen-mode plugins. For now, we switch to a personal fork of `snacks.nvim` which enables explicit enabling and disabling of the zen mode. If it gets upstreamed we can switch back to the regular snacks plugin. Streamlined some snacks loading and optional lazy-loading. --- nvim/.config/nvim/lazy-lock.json | 3 +- nvim/.config/nvim/lua/modules/base.lua | 9 ++++- .../nvim/lua/modules/data_analysis.lua | 9 ++++- nvim/.config/nvim/lua/modules/prose.lua | 37 ++++--------------- 4 files changed, 24 insertions(+), 34 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index bc7864b..f55a81a 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -89,12 +89,12 @@ "rainbow-delimiters.nvim": { "branch": "master", "commit": "1ab18259472d9fe5756750fec722c31bab1712da" }, "render-markdown.nvim": { "branch": "main", "commit": "6d03af10063d5a2fadec3559de5dfa68da7d00ef" }, "smartcolumn.nvim": { "branch": "main", "commit": "d01b99355c7fab13233f48d0f28dc097e68a03f7" }, + "snacks": { "branch": "feat/zen-explicit-enable-disable", "commit": "24459ae8a2a2fed8b7576fc16919439d1f697e29" }, "stay-centered.nvim": { "branch": "main", "commit": "e1a63ccaf2584e97c0ef8e64f9654c9a80d983f6" }, "stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" }, "texpresso.vim": { "branch": "main", "commit": "907838c08bbf99ad6bed3c908f1d0551a92ab4e0" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "trouble.nvim": { "branch": "main", "commit": "748ca2789044607f19786b1d837044544c55e80a" }, - "twilight.nvim": { "branch": "main", "commit": "8bb7fa7b918baab1ca81b977102ddb54afa63512" }, "typst-preview.nvim": { "branch": "master", "commit": "dea4525d5420b7c32eebda7de15a6beb9d6574fa" }, "undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" }, "vifm.vim": { "branch": "master", "commit": "617e3dc7c9af1f03cc664124aff2fe98fafcf1b2" }, @@ -103,6 +103,5 @@ "wezterm.nvim": { "branch": "main", "commit": "f73bba23ab4becd146fa2d0a3a16a84b987eeaca" }, "which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" }, "wrapping.nvim": { "branch": "master", "commit": "bbf1b6e4d6a94f1c362125dc927284086e9fad7d" }, - "zen-mode.nvim": { "branch": "main", "commit": "04b52674b8c800f8b7d4609e8bd8d0212e3ffa79" }, "zk-nvim": { "branch": "main", "commit": "fd1ab2239ed85ca51051c094a49a280f4ed76bb2" } } diff --git a/nvim/.config/nvim/lua/modules/base.lua b/nvim/.config/nvim/lua/modules/base.lua index 57bd8fc..988eb8d 100644 --- a/nvim/.config/nvim/lua/modules/base.lua +++ b/nvim/.config/nvim/lua/modules/base.lua @@ -381,7 +381,14 @@ return { }, }, }, - { "folke/snacks.nvim", lazy = false, opts = {} }, + { + "marty-oehme/snacks.nvim", + name = "snacks", + branch = "feat/zen-explicit-enable-disable", + version = false, + lazy = false, + opts = {}, + }, -- try to avoid putting files in util buffers, e.g. filetree, aerial, undotree, .. { "stevearc/stickybuf.nvim", config = true }, -- make it a little less painful to open really big (>2mb) files by disabling features diff --git a/nvim/.config/nvim/lua/modules/data_analysis.lua b/nvim/.config/nvim/lua/modules/data_analysis.lua index 6446777..008218c 100644 --- a/nvim/.config/nvim/lua/modules/data_analysis.lua +++ b/nvim/.config/nvim/lua/modules/data_analysis.lua @@ -54,11 +54,18 @@ return { }, -- image display + { + "snacks", + optional = true, + cond = vim.fn.executable("magick") == 1, -- if not available fall back to image.nvim + opts = { image = { enabled = true } }, + }, { -- "3rd/image.nvim", -- using Fork until https://github.com/3rd/image.nvim/pull/280 is merged "UnaTried/image.nvim", name = "image.nvim", version = false, + cond = vim.fn.executable("magick") == 0, -- prefer snacks.nvim/image if magick available dependencies = { { "leafo/magick" }, -- luarock, ensure global luarock51 dependency { "nvim-treesitter/nvim-treesitter", optional = true }, @@ -112,7 +119,7 @@ return { dependencies = { { "willothy/wezterm.nvim", config = true }, { - "folke/snacks.nvim", + "snacks", optional = true, opts = { image = { enabled = true } }, cond = vim.fn.executable("magick") == 1, -- only runs if ImageMagick installed diff --git a/nvim/.config/nvim/lua/modules/prose.lua b/nvim/.config/nvim/lua/modules/prose.lua index eef7e48..44f659c 100644 --- a/nvim/.config/nvim/lua/modules/prose.lua +++ b/nvim/.config/nvim/lua/modules/prose.lua @@ -44,21 +44,17 @@ local prose_plugs = { -- UI improvements -- provide distraction free writing { - "folke/zen-mode.nvim", - config = true, - cmd = { "ZenMode" }, - dependencies = { - { "folke/snacks.nvim", optional = true, opts = { dim = { enabled = true } } }, - { "arnamak/stay-centered.nvim", opts = { enabled = false } }, + "snacks", + opts = { + zen = {}, + styles = { zen = { backdrop = { transparent = false }, minimal = true } }, }, + dependencies = { { "arnamak/stay-centered.nvim", opts = { enabled = false } } }, keys = { { "[sz", function() - require("zen-mode").close() - if require("core.util").is_available("snacks") then - Snacks.dim.disable() - end + Snacks.zen.disable() require("stay-centered").disable() end, silent = true, @@ -67,31 +63,12 @@ local prose_plugs = { { "]sz", function() - require("zen-mode").open() - if require("core.util").is_available("snacks") then - Snacks.dim.enable() - end + Snacks.zen.enable() require("stay-centered").enable() end, silent = true, desc = "start center zen mode", }, - { - "[sZ", - function() - require("zen-mode").close() - end, - silent = true, - desc = "stop zen mode", - }, - { - "]sZ", - function() - require("zen-mode").open() - end, - silent = true, - desc = "start zen mode", - }, }, }, { From dc71f747da6d16f52f288ec296de2c0d39e51a26 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 29 Nov 2025 15:58:51 +0100 Subject: [PATCH 7/8] nu: Copy basic sh aliases Held back a little by the issue that you can't really set aliases conditionally (yet?) in nushell, which is kind of fundamental to my zsh/sh alias setup. If a program exists, we add some nice aliases -- if not, we simply degrade gracefully and don't add anything. PR to track issue: https://github.com/nushell/nushell/issues/5068 --- sh/.config/sh/alias | 5 +- terminal/.config/nushell/autoload/alias.nu | 59 ++++++++++++++++++++++ terminal/.config/nushell/config.nu | 14 ----- 3 files changed, 63 insertions(+), 15 deletions(-) create mode 100644 terminal/.config/nushell/autoload/alias.nu diff --git a/sh/.config/sh/alias b/sh/.config/sh/alias index 21a296e..0fa829a 100644 --- a/sh/.config/sh/alias +++ b/sh/.config/sh/alias @@ -8,7 +8,10 @@ exist() { type "$1" >/dev/null 2>&1; } unalias -a if alias v >/dev/null 2>&1; then - if exist vim; then + if exist nvim; then + alias v="nvim" + alias vim="vi" + elif exist vim; then alias v="vim" else alias v="vi" diff --git a/terminal/.config/nushell/autoload/alias.nu b/terminal/.config/nushell/autoload/alias.nu new file mode 100644 index 0000000..1da6727 --- /dev/null +++ b/terminal/.config/nushell/autoload/alias.nu @@ -0,0 +1,59 @@ +alias ":q" = exit # quit nushell + +def --wrapped vim [...rest] { + let cmds = which nvim vim vi | where path != "" + if ($cmds | is-empty) { + error make {msg: "No vi-like binary found."} + } + let c = $cmds | first | get path + ^$c ...$rest +} +alias v = vim # start ideal vim (nvim/vim/vi) + +alias l = ls # list files +alias L = ls --all # list files including hidden +alias ll = ls **/* # list files recursively +alias LL = ls --all **/* # list files recursively including hidden +# can additionally support `eza` output when +# PR https://github.com/eza-community/eza/issues/768 lands + +# make directory +alias md = mkdir +# make and enter directory +def --env mcd [path: path] { + mkdir $path + cd $path +} + +alias cl = clear # clear screen + +# FIXME: cll functionality seems hard to accomplish? + +alias myip = http get icanhazip.com # return current ip + +def --env --wrapped vmm [...rest] { + if (which vifm | is-not-empty) { + let rest = $rest | each {path expand} + vifm ...$rest $env.PWD + } else { + print "No vifm executable found." + } +} +alias vm = vifm + +def --wrapped iv [...rest] { + let cmds = which vimiv imv nsxiv sxiv feh | where path != "" + if ($cmds | is-empty) { + error make {msg: "No image viewer binary found."} + } + let c = $cmds | first | get path + ^$c ...$rest +} + +alias db = distrobox + +alias sc = sc-im + +# job control +# TODO: requires minimum nushell: 0.103 for job control, how to check for it? +alias fg = job unfreeze diff --git a/terminal/.config/nushell/config.nu b/terminal/.config/nushell/config.nu index 36173e5..d483f7a 100644 --- a/terminal/.config/nushell/config.nu +++ b/terminal/.config/nushell/config.nu @@ -146,17 +146,3 @@ $env.config.keybindings = [ } } ] - -alias l = ls -alias cl = clear - -alias md = mkdir -def --env mcd [path: path] { - mkdir $path - cd $path -} - -alias v = nvim - -# requires minimum nushell: 0.103 for job control -alias fg = job unfreeze From 726c7cf9c0b300f64584ff1f9c4c88c420cbf8bc Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 30 Nov 2025 22:52:03 +0100 Subject: [PATCH 8/8] nu: Add jj aliases --- vcs/jj/config/nushell/autoload/jj.nu | 73 ++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 vcs/jj/config/nushell/autoload/jj.nu diff --git a/vcs/jj/config/nushell/autoload/jj.nu b/vcs/jj/config/nushell/autoload/jj.nu new file mode 100644 index 0000000..43184cc --- /dev/null +++ b/vcs/jj/config/nushell/autoload/jj.nu @@ -0,0 +1,73 @@ +# exactly mirror the aliases in sh/ + +alias j = jj +alias lj = lazyjj + +alias jn = jj new +alias jna = jj new -A@ +alias jnb = jj new -B@ +alias jds = jj describe +alias jc = jj commit + +alias js = jj status +alias jw = jj show +alias jd = jj diff + +alias je = jj edit +alias jen = jj next --edit +alias jep = jj prev --edit +alias jenn = jj next +alias jepp = jj prev + +alias jed = jj edit -r 'latest(heads(descendants(@)))' # edit furthest descendant +alias jet = jj edit -r 'latest(heads(descendants(trunk())))' # edit trunk descendant +alias jel = jj edit -r 'latest(all())' # edit newest change + +alias jss = jj squash +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 +alias jl = jj log -T builtin_log_oneline -r 'recent()' +alias JL = jj log -T builtin_log_oneline -r 'all()' +alias jlo = jj log --summary -T builtin_log_compact_full_description -r 'recent()' +alias JLO = jj log --summary -T builtin_log_compact_full_description -r 'all()' +alias jloo = jj log --patch -r 'recent()' +alias JLOO = jj log --patch -r 'all()' +alias jlr = jj log # 'raw' log mode for custom opts +alias jol = jj op log + +# Find given term in change descriptions +def --wrapped jlf [search: string, ...flags] { + ^jj log -r $"description\(substring-i:\"($search)\"\)" ...$flags +} +# Find given term in change descriptions and display summary +def --wrapped jlof [search: string, ...flags] { + ^jj log --summary -r $"description\(substring-i:\"($search)\"\)" ...$flags +} +# Find given term in change descriptions and display patches +def --wrapped jloof [search: string, ...flags] { + ^jj log --patch -r $"description\(substring-i:\"($search)\"\)" ...$flags +} +alias jlfw = jj log -r "wip()" # Find 'WIP:'-prefixed changes +alias jlfp = jj log -r "private()" # Find 'PRIVATE:'-prefixed changes + +alias jh = jj log -r 'ancestors(heads(all()), 3)' + +alias jrb = jj rebase + +alias jb = jj bookmark +alias jbl = jj bookmark list +# Set 'main' bookmark to given revision, or to current ('@') +def --wrapped jbm [rev: string = "@", ...flags] { + ^jj bookmark set -r $rev main +} + +alias jrv = jj git remote list +alias jp = jj git push