From 159e8afaadfe2bf886abec1a965b24578b900597 Mon Sep 17 00:00:00 2001 From: Joseph LaFreniere Date: Tue, 14 Apr 2026 15:56:37 -0500 Subject: feat(agent-shell): unbind n and p Remove the upstream `n` and `p` bindings from `agent-shell-mode-map`, which would otherwise intercept keystrokes in insert state. --- evil-collection.el | 1 + modes/agent-shell/evil-collection-agent-shell.el | 44 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 modes/agent-shell/evil-collection-agent-shell.el diff --git a/evil-collection.el b/evil-collection.el index f776722..10fa6f2 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -144,6 +144,7 @@ See `evil-collection-init' and `evil-collection--modes-with-delayed-setup'." (defvar evil-collection--supported-modes `(2048-game ag + agent-shell alchemist anaconda-mode apropos diff --git a/modes/agent-shell/evil-collection-agent-shell.el b/modes/agent-shell/evil-collection-agent-shell.el new file mode 100644 index 0000000..2c38f45 --- /dev/null +++ b/modes/agent-shell/evil-collection-agent-shell.el @@ -0,0 +1,44 @@ +;;; evil-collection-agent-shell.el --- Bindings for agent-shell -*- lexical-binding: t -*- + +;; Copyright (C) 2026 Joseph LaFreniere + +;; Author: Joseph LaFreniere +;; Maintainer: Joseph LaFreniere +;; URL: https://github.com/emacs-evil/evil-collection +;; Version: 0.0.1 +;; Package-Requires: ((emacs "29.1")) +;; Keywords: evil, agent-shell, tools + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: +;;; Bindings for agent-shell. + +;;; Code: +(require 'evil-collection) +(require 'agent-shell nil t) + +(defconst evil-collection-agent-shell-maps '(agent-shell-mode-map)) + +;;;###autoload +(defun evil-collection-agent-shell-setup () + "Set up `evil' bindings for `agent-shell'." + ;; `agent-shell-mode-map' binds \"n\" and \"p\" at the map level, which causes + ;; them to intercept keystrokes even in insert state. Remove those bindings + ;; entirely. + (define-key agent-shell-mode-map "n" nil) + (define-key agent-shell-mode-map "p" nil)) + +(provide 'evil-collection-agent-shell) +;;; evil-collection-agent-shell.el ends here -- cgit v1.0