Skip to content

Commit

Permalink
Revert "compleseus: disable ido and respect minibuffer binds evilific…
Browse files Browse the repository at this point in the history
…ation setting (syl20bnr#15710)"

This reverts commit d6c3482.
  • Loading branch information
thanhvg committed Apr 15, 2024
1 parent 5a3bdc3 commit 5b98278
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 32 deletions.
6 changes: 0 additions & 6 deletions core/core-dotspacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,6 @@ in `dotspacemacs-themes'.")
(const hybrid) (cons symbol sexp))
'spacemacs-dotspacemacs-init)

(defun spacemacs//support-evilified-buffer-p ()
"Return non-nil if evil navigation should be enabled."
(or (eq dotspacemacs-editing-style 'vim)
(and (eq dotspacemacs-editing-style 'hybrid)
hybrid-style-enable-evilified-state)))

(spacemacs|defc dotspacemacs-startup-banner 'official
"Specify the startup banner. Default value is `official', it displays
the official spacemacs logo. An integer value is the index of text
Expand Down
43 changes: 18 additions & 25 deletions layers/+completion/compleseus/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -335,22 +335,18 @@
(defun compleseus/init-selectrum ()
(use-package selectrum
:init
;; Disable ido. We want to use the regular find-file etc.; enhanced by selectrum
(setq ido-mode nil)

(selectrum-mode)
(spacemacs/set-leader-keys
"rl" 'selectrum-repeat
"sl" 'selectrum-repeat)

:config
(when (spacemacs//support-evilified-buffer-p)
(define-key selectrum-minibuffer-map (kbd "C-j") 'selectrum-next-candidate)
(define-key selectrum-minibuffer-map (kbd "C-r") 'consult-history)
(define-key selectrum-minibuffer-map (kbd "C-k") 'selectrum-previous-candidate)
(define-key selectrum-minibuffer-map (kbd "C-M-k") #'spacemacs/selectrum-previous-candidate-preview)
(define-key selectrum-minibuffer-map (kbd "C-M-j") #'spacemacs/selectrum-next-candidate-preview)
(define-key selectrum-minibuffer-map (kbd "C-SPC") #'spacemacs/embark-preview))))
;; TODO can we just use `minibuffer-mode-map'?
(define-key selectrum-minibuffer-map (kbd "C-j") 'selectrum-next-candidate)
(define-key selectrum-minibuffer-map (kbd "C-r") 'consult-history)
(define-key selectrum-minibuffer-map (kbd "C-k") 'selectrum-previous-candidate)
(define-key selectrum-minibuffer-map (kbd "C-M-k") #'spacemacs/selectrum-previous-candidate-preview)
(define-key selectrum-minibuffer-map (kbd "C-M-j") #'spacemacs/selectrum-next-candidate-preview)
(define-key selectrum-minibuffer-map (kbd "C-SPC") #'spacemacs/embark-preview)))

(defun compleseus/init-vertico ()
(use-package vertico
Expand Down Expand Up @@ -381,22 +377,18 @@
vertico-count 20
vertico-cycle nil)

;; Disable ido. We want to use the regular find-file etc.; enhanced by vertico
(setq ido-mode nil)

(vertico-mode)

:config
(when (spacemacs//support-evilified-buffer-p)
(define-key vertico-map (kbd "M-RET") #'vertico-exit-input)
(define-key vertico-map (kbd "C-SPC") #'spacemacs/embark-preview)
(define-key vertico-map (kbd "C-j") #'vertico-next)
(define-key vertico-map (kbd "C-M-j") #'spacemacs/next-candidate-preview)
(define-key vertico-map (kbd "C-S-j") #'vertico-next-group)
(define-key vertico-map (kbd "C-k") #'vertico-previous)
(define-key vertico-map (kbd "C-M-k") #'spacemacs/previous-candidate-preview)
(define-key vertico-map (kbd "C-S-k") #'vertico-previous-group)
(define-key vertico-map (kbd "C-r") #'consult-history))))
(define-key vertico-map (kbd "M-RET") #'vertico-exit-input)
(define-key vertico-map (kbd "C-SPC") #'spacemacs/embark-preview)
(define-key vertico-map (kbd "C-j") #'vertico-next)
(define-key vertico-map (kbd "C-M-j") #'spacemacs/next-candidate-preview)
(define-key vertico-map (kbd "C-S-j") #'vertico-next-group)
(define-key vertico-map (kbd "C-k") #'vertico-previous)
(define-key vertico-map (kbd "C-M-k") #'spacemacs/previous-candidate-preview)
(define-key vertico-map (kbd "C-S-k") #'vertico-previous-group)
(define-key vertico-map (kbd "C-r") #'consult-history)))

(defun compleseus/init-vertico-quick ()
(use-package vertico-quick
Expand All @@ -419,7 +411,8 @@
(defun compleseus/init-vertico-directory ()
(use-package vertico-directory
;; More convenient directory navigation commands
:init (bind-key "C-h" 'vertico-directory-delete-char vertico-map (spacemacs//support-evilified-buffer-p))
:bind (:map vertico-map
("C-h" . vertico-directory-delete-char))
;; Tidy shadowed file names
:hook (rfn-eshadow-update-overlay . vertico-directory-tidy)))

Expand Down
4 changes: 3 additions & 1 deletion layers/+lang/emacs-lisp/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ Unlike `eval-defun', this does not go to topmost function."

(defun spacemacs//edebug-mode (&rest args)
"Additional processing when `edebug-mode' is activated or deactivated."
(let ((evilified? (spacemacs//support-evilified-buffer-p)))
(let ((evilified? (or (eq 'vim dotspacemacs-editing-style)
(and (eq 'hybrid dotspacemacs-editing-style)
hybrid-style-enable-evilified-state))))
(if (not edebug-mode)
;; disable edebug-mode
(when evilified? (evil-evilified-state-exit))
Expand Down
6 changes: 6 additions & 0 deletions layers/+source-control/git/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@
(let (git-link-open-in-browser)
(call-interactively 'git-link-commit)))

(defun spacemacs//support-evilified-buffer-p ()
"Return non-nil if evil navigation should be enabled."
(or (eq dotspacemacs-editing-style 'vim)
(and (eq dotspacemacs-editing-style 'hybrid)
hybrid-style-enable-evilified-state)))


;; git blame transient state

Expand Down

0 comments on commit 5b98278

Please sign in to comment.