Skip to content

Customizable keyboard shortcut for toggling plan mode - #5

Open
karamanliev wants to merge 1 commit into
qmx:masterfrom
karamanliev:feature/customizable-keybind
Open

karamanliev wants to merge 1 commit into
qmx:masterfrom
karamanliev:feature/customizable-keybind

Conversation

@karamanliev

Copy link
Copy Markdown

Often you realize mid-prompt that you need plan mode: type out a question, notice you should explore first, then have to delete everything, run /plan, and type it again. A keyboard shortcut fixes this: tap Ctrl+Shift+P at any point, no text lost.

Summary

  • Registers ctrl+shift+p as default shortcut via pi.registerShortcut()
  • Extracts toggle logic into shared togglePlanMode() function (command + shortcut reuse same code)
  • Key is customizable in ~/.pi/agent/keybindings.json

Changes

  • plan-mode.ts: extract togglePlanMode(), add pi.registerShortcut("ctrl+shift+p", ...)
  • README.md: add Keyboard Shortcut section with customization example

@SolidusAbi

Copy link
Copy Markdown

I applied this behavior in the same way you did, as I also needed it. However, to my knowledge, keybindings are not directly usable in extensions since they are defined by an
interface. Have you been able to use it? Could you provide an example?

While keybindings through a custom JSON file could be worthwhile, I would not recommend creating a global configuration file for such a trivial parameter. Likewise, a CLI flag would be unnecessary.

Additionally, as a side note: ctrl+shift+p is a specific shortcut used by Ghostty (a popular terminal emulator) for its command palette. I'd suggest using a different shortcut instead. In my implementation, I used ctrl+k+p.

Anyway, I consider this shortcut a necessary addition. I hope @qmx considers this for merger!

@pkos98

pkos98 commented May 18, 2026

Copy link
Copy Markdown

Thanks @karamanliev - works just fine!

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.

3 participants