Compare commits

...

8 commits

Author SHA1 Message Date
726c7cf9c0
nu: Add jj aliases 2025-11-30 23:05:16 +01:00
dc71f747da
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
2025-11-30 23:05:15 +01:00
dc8030f905
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.
2025-11-30 23:05:15 +01:00
04fc9b8017
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.
2025-11-30 23:05:14 +01:00
e63681c16b
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.
2025-11-30 23:05:14 +01:00
63c4952118
nvim: Add prompts to codecompanion plugin 2025-11-30 23:05:13 +01:00
054cbd9ff5
nvim: Update codecompanion plugin 2025-11-30 23:05:12 +01:00
4bea6507c0
wezterm: Add key to detach selected pane into new window
`<leader><c-s-Q>` 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 `<leader><c-q>` 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.
2025-11-30 23:05:12 +01:00
10 changed files with 218 additions and 48 deletions

View file

@ -9,9 +9,9 @@
"cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" }, "cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" },
"cmp-pandoc.nvim": { "branch": "main", "commit": "30faa4456a7643c4cb02d8fa18438fd484ed7602" }, "cmp-pandoc.nvim": { "branch": "main", "commit": "30faa4456a7643c4cb02d8fa18438fd484ed7602" },
"cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, "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-history.nvim": { "branch": "main", "commit": "eb99d256352144cf3b6a1c45608ec25544a0813d" },
"codecompanion.nvim": { "branch": "main", "commit": "4bc03c40b8f7f5e5d3c324479a893c6589471446" }, "codecompanion.nvim": { "branch": "main", "commit": "e7762c68daf24c3e356401f5223eeb5217047754" },
"conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" },
"copilot-lualine": { "branch": "main", "commit": "6bc29ba1fcf8f0f9ba1f0eacec2f178d9be49333" }, "copilot-lualine": { "branch": "main", "commit": "6bc29ba1fcf8f0f9ba1f0eacec2f178d9be49333" },
"copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" }, "copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" },
@ -53,7 +53,7 @@
"mini.files": { "branch": "main", "commit": "49c855977e9f4821d1ed8179ed44fe098b93ea2a" }, "mini.files": { "branch": "main", "commit": "49c855977e9f4821d1ed8179ed44fe098b93ea2a" },
"mini.nvim": { "branch": "main", "commit": "94cae4660a8b2d95dbbd56e1fbc6fcfa2716d152" }, "mini.nvim": { "branch": "main", "commit": "94cae4660a8b2d95dbbd56e1fbc6fcfa2716d152" },
"mini.starter": { "branch": "main", "commit": "d8038690eadf203a40863c3a9423df880a901d39" }, "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-jj.nvim": { "branch": "main", "commit": "c6534930c6f79893e12eafbb722ee23e6a83e80e" },
"neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" },
"neogen": { "branch": "main", "commit": "b2e78708876f4da507839726816010a68e33fec8" }, "neogen": { "branch": "main", "commit": "b2e78708876f4da507839726816010a68e33fec8" },
@ -89,13 +89,12 @@
"rainbow-delimiters.nvim": { "branch": "master", "commit": "1ab18259472d9fe5756750fec722c31bab1712da" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "1ab18259472d9fe5756750fec722c31bab1712da" },
"render-markdown.nvim": { "branch": "main", "commit": "6d03af10063d5a2fadec3559de5dfa68da7d00ef" }, "render-markdown.nvim": { "branch": "main", "commit": "6d03af10063d5a2fadec3559de5dfa68da7d00ef" },
"smartcolumn.nvim": { "branch": "main", "commit": "d01b99355c7fab13233f48d0f28dc097e68a03f7" }, "smartcolumn.nvim": { "branch": "main", "commit": "d01b99355c7fab13233f48d0f28dc097e68a03f7" },
"snacks": { "branch": "feat/zen-explicit-enable-disable", "commit": "24459ae8a2a2fed8b7576fc16919439d1f697e29" },
"stay-centered.nvim": { "branch": "main", "commit": "e1a63ccaf2584e97c0ef8e64f9654c9a80d983f6" }, "stay-centered.nvim": { "branch": "main", "commit": "e1a63ccaf2584e97c0ef8e64f9654c9a80d983f6" },
"stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" }, "stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" },
"texpresso.vim": { "branch": "main", "commit": "907838c08bbf99ad6bed3c908f1d0551a92ab4e0" }, "texpresso.vim": { "branch": "main", "commit": "907838c08bbf99ad6bed3c908f1d0551a92ab4e0" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"tree-sitter-nu": { "branch": "main", "commit": "b64f0d1c93a76d167fabb01271905f0d18c5f10c" },
"trouble.nvim": { "branch": "main", "commit": "748ca2789044607f19786b1d837044544c55e80a" }, "trouble.nvim": { "branch": "main", "commit": "748ca2789044607f19786b1d837044544c55e80a" },
"twilight.nvim": { "branch": "main", "commit": "8bb7fa7b918baab1ca81b977102ddb54afa63512" },
"typst-preview.nvim": { "branch": "master", "commit": "dea4525d5420b7c32eebda7de15a6beb9d6574fa" }, "typst-preview.nvim": { "branch": "master", "commit": "dea4525d5420b7c32eebda7de15a6beb9d6574fa" },
"undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" }, "undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" },
"vifm.vim": { "branch": "master", "commit": "617e3dc7c9af1f03cc664124aff2fe98fafcf1b2" }, "vifm.vim": { "branch": "master", "commit": "617e3dc7c9af1f03cc664124aff2fe98fafcf1b2" },
@ -104,6 +103,5 @@
"wezterm.nvim": { "branch": "main", "commit": "f73bba23ab4becd146fa2d0a3a16a84b987eeaca" }, "wezterm.nvim": { "branch": "main", "commit": "f73bba23ab4becd146fa2d0a3a16a84b987eeaca" },
"which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" }, "which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" },
"wrapping.nvim": { "branch": "master", "commit": "bbf1b6e4d6a94f1c362125dc927284086e9fad7d" }, "wrapping.nvim": { "branch": "master", "commit": "bbf1b6e4d6a94f1c362125dc927284086e9fad7d" },
"zen-mode.nvim": { "branch": "main", "commit": "04b52674b8c800f8b7d4609e8bd8d0212e3ffa79" },
"zk-nvim": { "branch": "main", "commit": "fd1ab2239ed85ca51051c094a49a280f4ed76bb2" } "zk-nvim": { "branch": "main", "commit": "fd1ab2239ed85ca51051c094a49a280f4ed76bb2" }
} }

View file

@ -381,6 +381,14 @@ return {
}, },
}, },
}, },
{
"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, .. -- try to avoid putting files in util buffers, e.g. filetree, aerial, undotree, ..
{ "stevearc/stickybuf.nvim", config = true }, { "stevearc/stickybuf.nvim", config = true },
-- make it a little less painful to open really big (>2mb) files by disabling features -- make it a little less painful to open really big (>2mb) files by disabling features

View file

@ -54,11 +54,18 @@ return {
}, },
-- image display -- 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 -- "3rd/image.nvim", -- using Fork until https://github.com/3rd/image.nvim/pull/280 is merged
"UnaTried/image.nvim", "UnaTried/image.nvim",
name = "image.nvim", name = "image.nvim",
version = false, version = false,
cond = vim.fn.executable("magick") == 0, -- prefer snacks.nvim/image if magick available
dependencies = { dependencies = {
{ "leafo/magick" }, -- luarock, ensure global luarock51 dependency { "leafo/magick" }, -- luarock, ensure global luarock51 dependency
{ "nvim-treesitter/nvim-treesitter", optional = true }, { "nvim-treesitter/nvim-treesitter", optional = true },
@ -108,8 +115,16 @@ return {
-- REPL work -- REPL work
{ {
"benlubas/molten-nvim", "benlubas/molten-nvim",
version = false,
dependencies = { dependencies = {
{ "willothy/wezterm.nvim", config = true }, { "willothy/wezterm.nvim", config = true },
{
"snacks",
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 }, { "image.nvim", optional = true },
}, },
build = ":UpdateRemotePlugins", build = ":UpdateRemotePlugins",

View file

@ -134,14 +134,14 @@ return {
url = "https://api.groq.com/openai/v1/chat/completions", url = "https://api.groq.com/openai/v1/chat/completions",
schema = { schema = {
model = { model = {
default = "llama-3.1-8b-instant", default = "moonshotai/kimi-k2-instruct-0905",
choices = { choices = {
-- production models -- production models
"openai/gpt-oss-120b",
"moonshotai/kimi-k2-instruct-0905",
"llama-3.3-70b-versatile", "llama-3.3-70b-versatile",
"llama-3.1-8b-instant", "llama-3.1-8b-instant",
"moonshotai/kimi-k2-instruct-0905",
"meta-llama/llama-guard-4-12b", "meta-llama/llama-guard-4-12b",
"openai/gpt-oss-120b",
"openai/gpt-oss-20b", "openai/gpt-oss-20b",
-- preview models -- preview models
"meta-llama/llama-4-maverick-17b-128e-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct",
@ -195,12 +195,49 @@ return {
callback = "mcphub.extensions.codecompanion", callback = "mcphub.extensions.codecompanion",
opts = { opts = {
show_results_in_chat = true, show_results_in_chat = true,
make_vars = true, make_tools = true, -- Make individual tools (@server__tool) and server groups (@server) from MCP servers
make_slash_commands = true, 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 = { 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"] = { ["Smart Paste"] = {
strategy = "inline", strategy = "inline",
description = "Paste code smartly", description = "Paste code smartly",

View file

@ -44,15 +44,17 @@ local prose_plugs = {
-- UI improvements -- UI improvements
-- provide distraction free writing -- provide distraction free writing
{ {
"folke/zen-mode.nvim", "snacks",
config = true, opts = {
cmd = { "ZenMode" }, zen = {},
dependencies = { "folke/twilight.nvim", { "arnamak/stay-centered.nvim", opts = { enabled = false } } }, styles = { zen = { backdrop = { transparent = false }, minimal = true } },
},
dependencies = { { "arnamak/stay-centered.nvim", opts = { enabled = false } } },
keys = { keys = {
{ {
"[sz", "[sz",
function() function()
require("zen-mode").close() Snacks.zen.disable()
require("stay-centered").disable() require("stay-centered").disable()
end, end,
silent = true, silent = true,
@ -61,28 +63,12 @@ local prose_plugs = {
{ {
"]sz", "]sz",
function() function()
require("zen-mode").open() Snacks.zen.enable()
require("stay-centered").enable() require("stay-centered").enable()
end, end,
silent = true, silent = true,
desc = "start center zen mode", 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",
},
}, },
}, },
{ {

View file

@ -8,7 +8,10 @@ exist() { type "$1" >/dev/null 2>&1; }
unalias -a unalias -a
if alias v >/dev/null 2>&1; then 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" alias v="vim"
else else
alias v="vi" alias v="vi"

View file

@ -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

View file

@ -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

View file

@ -52,6 +52,11 @@ local keys = {
mods = "LEADER|CTRL", mods = "LEADER|CTRL",
action = act.PaneSelect({ mode = "MoveToNewTab" }), action = act.PaneSelect({ mode = "MoveToNewTab" }),
}, },
{
key = "Q",
mods = "LEADER|CTRL",
action = act.PaneSelect({ mode = "MoveToNewWindow" }),
},
{ {
key = "R", key = "R",
mods = "LEADER", mods = "LEADER",

View file

@ -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