Skip to content

Sidekick ergonomics: float toggle, zoom, escape, yank-joined#4

Open
GuillaumeLagrange wants to merge 2 commits into
mainfrom
nvim/sidekick-ergonomics
Open

Sidekick ergonomics: float toggle, zoom, escape, yank-joined#4
GuillaumeLagrange wants to merge 2 commits into
mainfrom
nvim/sidekick-ergonomics

Conversation

@GuillaumeLagrange
Copy link
Copy Markdown
Owner

@GuillaumeLagrange GuillaumeLagrange commented May 15, 2026

Summary

Quality-of-life tweaks for the folke/sidekick.nvim workflow, plus a small visual-mode yank helper.

nvim/plugin/ai.lua

  • Esc / Esc-Esc in sidekick terminal buffer only: added cli.win.keys entries (stopinsert, stopinsert2) so <esc> and <esc><esc> both stopinsert in the sidekick CLI window without clobbering the global terminal <esc> mapping.
  • <leader>aF — toggle the sidekick CLI between a 95%/95% float and the default right split (mode n/t).
  • <leader>azSnacks.zoom() toggle (snacks.nvim is already a dep via nvim/plugin/snacks.lua), mode n/t.

nvim/lua/keymaps.lua

  • <leader>yj in visual mode — yanks the selection, collapses all internal whitespace/newlines into single spaces, trims, and writes the result to the + register. Notifies with the resulting char count.

Layout notes

This repo uses vim.pack (not lazy.nvim). The lazy-style keys = { … } and opts.cli.win.keys blocks from the task description were adapted into the existing setup() call and vim.keymap.set calls in nvim/plugin/ai.lua.

Manual step (Claude Code config not tracked here)

This repo does not track any claude/ or .claude/ directory, so keybindings.json was not added.

In the Chat context, only one action is bound to escape by default: chat:cancel (cancels the current request/input). To move it off escape — so Neovim's terminal-mode <esc> from this PR can pass through cleanly — drop the following at ~/.claude/keybindings.json:

{
  "$schema": "https://www.schemastore.org/claude-code-keybindings.json",
  "bindings": [
    {
      "context": "Chat",
      "bindings": {
        "ctrl+shift+c": "chat:cancel",
        "escape": null
      }
    }
  ]
}

Notes:

  • The other default escape bindings (autocomplete:dismiss, help:dismiss, confirm:no) live in other contexts and are unaffected.
  • An action can be bound to multiple keys — to keep escape working and add a second key, drop the "escape": null line.
  • Reference: https://code.claude.com/docs/en/keybindings

Validation

  • luajit -bl parses both nvim/plugin/ai.lua and nvim/lua/keymaps.lua cleanly (Neovim not installed in this environment, so the nvim --headless runtime check was substituted with a Lua syntax check).

Test plan

  • In a sidekick CLI window, <esc> exits terminal insert mode (and only there).
  • <leader>aF toggles between float (95%×95%) and right split.
  • <leader>az zooms the current window via Snacks.zoom(); pressing again unzooms.
  • In visual mode, <leader>yj puts a single-line, whitespace-collapsed copy of the selection into the system clipboard and notifies with the char count.

claude added 2 commits May 15, 2026 06:42
…ined

- sidekick: add terminal-mode <esc>/<esc><esc> to stopinsert in cli win
- sidekick: <leader>aF toggles float/right split (95% float)
- sidekick: <leader>az zooms the current window (tab-scoped)
- keymaps: <leader>yj in visual mode yanks joined (single line) to +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants