From 1f328d26633aeddbf2c70c23b33337c0d7f9d163 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 23 Aug 2025 12:38:45 +0200 Subject: [PATCH 1/6] nvim: Add copilot suggestions to blink Suggestions are given at the top of the completion menu. Additionally, since that can get really annoying really quick there have been some changes specifically for copilot.lua: We start with it disabled. It can be enabled with `ap` and disabled again with `aP` for Ai>coPilot. If the plugin at some point exposes functionality to toggle itself on/off completely I would gladly switch to that. The current toggle command only attaches/detaches the buffer but still runs the client in the background. This is less desirable for me, plus it means the completions are still done automatically in blink. --- nvim/.config/nvim/lazy-lock.json | 1 + nvim/.config/nvim/lua/plugins/llm.lua | 67 +++++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 77a53ba..17a3aec 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -3,6 +3,7 @@ "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" }, "bats.vim": { "branch": "master", "commit": "6a5d2ef22b0ede503d867770afd02ebb1f97b709" }, + "blink-copilot": { "branch": "main", "commit": "41e91a659bd9b8cba9ba2ea68a69b52ba5a9ebd8" }, "blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" }, "blink.compat": { "branch": "main", "commit": "2ed6d9a28b07fa6f3bface818470605f8896408c" }, "cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" }, diff --git a/nvim/.config/nvim/lua/plugins/llm.lua b/nvim/.config/nvim/lua/plugins/llm.lua index 38a90ba..7d90eaa 100644 --- a/nvim/.config/nvim/lua/plugins/llm.lua +++ b/nvim/.config/nvim/lua/plugins/llm.lua @@ -2,22 +2,79 @@ return { { -- NOTE: Requires manual auth with ':Copilot auth' or 'GH_COPILOT_TOKEN' set as envvar "zbirenbaum/copilot.lua", - dependencies = { "AndreM222/copilot-lualine" }, + dependencies = { + "AndreM222/copilot-lualine", + { -- show completions in blink + "saghen/blink.cmp", + optional = true, + dependencies = { + { + "fang2hou/blink-copilot", + opts = { + auto_refresh = { + backward = false, + forward = false, + }, + }, + }, + }, + opts = { + sources = { + default = { "copilot" }, + providers = { + copilot = { + name = "copilot", + module = "blink-copilot", + score_offset = 100, + async = true, + }, + }, + }, + }, + }, + }, cmd = "Copilot", - event = "InsertEnter", + event = { "InsertEnter", "VeryLazy" }, opts = { panel = { layout = { position = "bottom" } }, suggestion = { keymap = { accept = "" } }, + logger = { print_log_level = vim.log.levels.ERROR }, }, + config = function(_, opts) + require("copilot").setup(opts) + -- TODO: See also https://github.com/zbirenbaum/copilot.lua/issues/302 for potential + -- better solutions. + -- TODO: also Find way of having a 'toggle' for mapping below. + -- Current copilot.lua exposed 'toggle' command does NOT do the same. + require("copilot.command").disable() + end, keys = { { - "ap", + "aC", function() - -- FIXME: If opening before lazy-loaded, errors + require("copilot.panel").setup() require("copilot.panel").open({}) require("copilot.panel").refresh() end, - desc = "Refresh Copilot Panel", + desc = "Open copilot panel", + silent = true, + mode = { "n" }, + }, + { + "ap", + function() + require("copilot.command").enable() + end, + desc = "Enable copilot", + silent = true, + mode = { "n" }, + }, + { + "aP", + function() + require("copilot.command").disable() + end, + desc = "Disable copilot", silent = true, mode = { "n" }, }, From c3e2720b3c74a45ffe054525fad403bd993dc6af Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 27 Sep 2025 11:02:32 +0200 Subject: [PATCH 2/6] wezterm: Rename tabs Rename tabs with ``. This will provide a (full-screen) prompt in which you can exit with esc (not changing anything), provide a static name for the tab, or hit enter with nothing on the prompt to return to the default naming behavior. --- terminal/.config/wezterm/maps.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/terminal/.config/wezterm/maps.lua b/terminal/.config/wezterm/maps.lua index 57d0740..40cc692 100644 --- a/terminal/.config/wezterm/maps.lua +++ b/terminal/.config/wezterm/maps.lua @@ -52,6 +52,19 @@ local keys = { mods = "LEADER|CTRL", action = act.PaneSelect({ mode = "MoveToNewTab" }), }, + { + key = "R", + mods = "LEADER", + action = act.PromptInputLine({ + description = "Enter new name for tab", + action = wezterm.action_callback(function(win, _, line) + if line then + win:active_tab():set_title(line) + end + end), + }), + }, + { key = "c", mods = "LEADER", action = act.SpawnTab("CurrentPaneDomain") }, { key = ",", mods = "LEADER", action = act.ActivateTabRelative(-1) }, { key = ".", mods = "LEADER", action = act.ActivateTabRelative(1) }, -- workspace selection @@ -62,6 +75,7 @@ local keys = { mods = "LEADER", action = act.ShowLauncherArgs({ flags = "FUZZY|WORKSPACES" }), }, + { key = "t", mods = "LEADER", action = act.EmitEvent("toggle-tabbar") }, { key = "T", mods = "LEADER", action = act.ShowTabNavigator }, { key = "[", mods = "LEADER", action = act.ActivateCopyMode }, { @@ -105,7 +119,6 @@ local keys = { }, { key = "e", mods = "LEADER", action = act.EmitEvent("edit-scrollback") }, { key = "a", mods = "CTRL|ALT", action = act.EmitEvent("toggle-leader") }, - { key = "t", mods = "LEADER", action = act.EmitEvent("toggle-tabbar") }, { key = ":", mods = "LEADER|SHIFT", From 7fa4b06eeaa9244b265cfeb9fcbb99f0012a7d2f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 30 Sep 2025 09:31:22 +0200 Subject: [PATCH 3/6] carapace: Alias cat to bat For some reason the regular 'cat' completion does not work, perhaps because it is regularly aliased to 'bat' on my systems. This manually fixes it with a spec alias for carapace (https://carapace-sh.github.io/carapace-bin/spec/run.html#alias) Should find a better implementation over time but for now this is a simple workaround. I do _not_ know how it interacts with systems when no 'bat' command is found. --- sh/.config/carapace/specs/cat.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sh/.config/carapace/specs/cat.yaml diff --git a/sh/.config/carapace/specs/cat.yaml b/sh/.config/carapace/specs/cat.yaml new file mode 100644 index 0000000..c73491b --- /dev/null +++ b/sh/.config/carapace/specs/cat.yaml @@ -0,0 +1,3 @@ +# yaml-language-server: $schema=https://carapace.sh/schemas/command.json +name: cat +run: "[bat]" From 36f6e0b30f44120369f5effaba608753778be907 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 30 Sep 2025 14:00:19 +0200 Subject: [PATCH 4/6] aerc: Split edit in compose view to edit headers by default --- office/.config/aerc/binds.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/office/.config/aerc/binds.conf b/office/.config/aerc/binds.conf index 1a2d6a4..4e348c4 100644 --- a/office/.config/aerc/binds.conf +++ b/office/.config/aerc/binds.conf @@ -209,7 +209,8 @@ x = :encrypt # Toggle encryption to all recipients v = :preview # Preview message p = :postpone # Postpone q = :choose -o d discard abort -o p postpone postpone # Abort or postpone -e = :edit # Edit (body and headers) +e = :edit -e # Edit, headers in-message +E = :edit -E # Edit, body and headers separate a = :attach -m # Add attachment d = :detach # Remove attachment From d8d126e51ecb13196b3576683a10582d72bbdb81 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 30 Sep 2025 14:33:39 +0200 Subject: [PATCH 5/6] office: Remove left-over calcurse alias I have not used calcurse in a _long_ time, preferring khal nowadays. This removes an old (vdir-enabling) alias in the office module. --- office/.config/sh/alias.d/calcurse-vdir.sh | 27 ---------------------- 1 file changed, 27 deletions(-) delete mode 100644 office/.config/sh/alias.d/calcurse-vdir.sh diff --git a/office/.config/sh/alias.d/calcurse-vdir.sh b/office/.config/sh/alias.d/calcurse-vdir.sh deleted file mode 100644 index 91a8403..0000000 --- a/office/.config/sh/alias.d/calcurse-vdir.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env sh -# -# Wraps around the calcurse invocation and syncs calendar data -# to local vdir - given by default below. -# -# For now ONLY PROVIDES ONE-WAY Synchronization, see below. - -# The path in which *the calendars* reside (i.e. toplevel with access to all paths) -CAL_PATH="$HOME/documents/calendars" - -calcurse() { - find "$CAL_PATH" -maxdepth 1 -type d -exec calcurse-vdir import {} \; -} - -# Enable two-way sync. One issue is that calcurse would sync everything -# into the top-level path (or the selected calendar path) since it makes -# not the same differentiation as the vdir between calendars. -# FIXME Not sure how to resolve currently. -# -# The below works as a simple two-way synchronization on exiting calcurse. -# To function the invocation has to be turned from a function above to an -# executable shell-script file instead. -# trap 'calcurse_export' 0 -# -# calcurse_export() { -# calcurse-vdir export "$CAL_PATH" -# } From 5c7b8ed564edb215479b16f822a13da7683e0bfa Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 30 Sep 2025 14:33:39 +0200 Subject: [PATCH 6/6] aerc: Add ikhal calendar key bind Open ikhal in an embedded terminal with k. --- office/.config/aerc/binds.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/office/.config/aerc/binds.conf b/office/.config/aerc/binds.conf index 4e348c4..5245faa 100644 --- a/office/.config/aerc/binds.conf +++ b/office/.config/aerc/binds.conf @@ -90,6 +90,8 @@ l = :view w = :filter tag:wait l = :filter tag:delegated +k = :terminal ikhal + d = :move Trash D = :choose -o y 'Really delete this message' :delete a = :archive flat # archive message