diff --git a/layers/+completion/compleseus/config.el b/layers/+completion/compleseus/config.el index f487547b330f..17fa4eb5b4d7 100644 --- a/layers/+completion/compleseus/config.el +++ b/layers/+completion/compleseus/config.el @@ -28,6 +28,9 @@ (defvar compleseus-use-nerd-icons nil "Use nerd-icons with marginalia to provide icons in the mini-buffer") +(defvar compleseus-use-vertico-posframe nil + "Use vertico-posframe to display completions in a separate frame") + (defvar compleseus-buffer-search-restrict-project t "If non-nil, `spacemacs/consult-line-multi' and `spacemacs/consult-line-multi-symbol' will be restricted to buffers of the current project. diff --git a/layers/+completion/compleseus/packages.el b/layers/+completion/compleseus/packages.el index 1ae1e0609407..45145a1edd81 100644 --- a/layers/+completion/compleseus/packages.el +++ b/layers/+completion/compleseus/packages.el @@ -41,6 +41,8 @@ (vertico :toggle (eq compleseus-engine 'vertico) :location elpa) + (vertico-posframe :togle (and (eq compleseus-engine 'vertico) + compleseus-use-vertico-posframe)) (grep :location built-in) wgrep)) @@ -463,6 +465,20 @@ "sl" 'vertico-repeat-previous "sL" 'vertico-repeat-select))) +(defun compleseus/init-vertico-posframe () + (use-package vertico-posframe + :after vertico + :init + (setq vertico-posframe-poshandler 'posframe-poshandler-frame-center) + (setq vertico-posframe-width (round (* 0.618 (frame-width)))) + (setq vertico-posframe-height (round (* 0.618 (frame-height)))) + (setq vertico-posframe-parameters + '((internal-border-width . 2) + (left-fringe . 4) + (right-fringe . 4) + (undecorated . nil))) + (vertico-posframe-mode 1))) + (defun compleseus/post-init-grep () (spacemacs/set-leader-keys-for-major-mode 'grep-mode "w" 'spacemacs/compleseus-grep-change-to-wgrep-mode