Skip to content

Commit

Permalink
README: Use keymap-set
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Aug 18, 2024
1 parent fac0d67 commit e0b7936
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e0b7936

Please sign in to comment.