Skip to content

Commit

Permalink
Add support for vertico-posframe in compleseus layer (#16634)
Browse files Browse the repository at this point in the history
* Add support for vertico-posframe in compleseus layer

* Improve vertico posframe display
  • Loading branch information
aam-at authored Nov 2, 2024
1 parent bd37f16 commit 6581c82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions layers/+completion/compleseus/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 16 additions & 0 deletions layers/+completion/compleseus/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6581c82

Please sign in to comment.