summaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2024-08-18 12:27:47 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2024-08-18 12:27:47 +0200
commite0b7936c21121158628bc2b392fc7a42e26ae536 (patch)
tree6ae4fe88f1d0c44800063da3ef2fbf11944654c3 /README.org
parentfac0d67eada9f0b665fb757fb483d9c73f6bb1f3 (diff)
README: Use keymap-set
Diffstat (limited to 'README.org')
-rw-r--r--README.org18
1 files changed, 9 insertions, 9 deletions
diff --git a/README.org b/README.org
index d0e05f3..dd93cb2 100644
--- a/README.org
+++ b/README.org
@@ -406,17 +406,17 @@ modes using a menu-item filter.
(corfu-auto t) ;; Enable auto completion
(corfu-preselect 'directory) ;; Select the first candidate, except for directories
+ :init
+
;; Free the RET key for less intrusive behavior.
- :bind
- (:map corfu-map
- ;; Option 1: Unbind RET completely
- ;;; ("RET" . nil)
- ;; Option 2: Use RET only in shell modes
- :filter
- (or (derived-mode-p 'eshell-mode) (derived-mode-p 'comint-mode))
- ("RET" . corfu-send))
+ ;; Option 1: Unbind RET completely
+ ;; (keymap-unset corfu-map "RET")
+ ;; Option 2: Use RET only in shell modes
+ (keymap-set corfu-map "RET" `( menu-item "" nil :filter
+ ,(lambda (&optional _)
+ (and (derived-mode-p 'eshell-mode 'comint-mode)
+ #'corfu-send))))
- :init
(global-corfu-mode))
#+end_src