summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph LaFreniere <git@lafreniere.xyz>2026-04-14 15:56:37 -0500
committerJames <1227856+jojojames@users.noreply.github.com>2026-04-16 23:42:31 -0700
commit159e8afaadfe2bf886abec1a965b24578b900597 (patch)
treee2227f2d49dae2a4cd83330824e9ab22e744672b
parent621826c4c9d91e81e62ab207fc50b4d37bceff2b (diff)
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.
-rw-r--r--evil-collection.el1
-rw-r--r--modes/agent-shell/evil-collection-agent-shell.el44
2 files changed, 45 insertions, 0 deletions
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 <git@lafreniere.xyz>
+;; Maintainer: Joseph LaFreniere <git@lafreniere.xyz>
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; 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