You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(use-package! vertico-posframe
:config
(setq vertico-posframe-poshandler 'posframe-poshandler-frame-center
vertico-posframe-width 100
vertico-posframe-min-width 100
vertico-posframe-height 15
vertico-posframe-min-height 15
vertico-posframe-border-width 2
vertico-posframe-fallback-mode #'ignore)
;; Use a modern horizontal ellipsis for truncation
(unless standard-display-table
(setq standard-display-table (make-display-table)))
(set-display-table-slot standard-display-table 'truncation (make-glyph-code?…))
;; Common parameters for a clean look
(setq vertico-posframe-parameters
'((left-fringe .8)
(right-fringe .8)
(internal-border-width .10)))
;; Linux-specific: Avoid parent-frame errors
(when IS-LINUX
(setq vertico-posframe-parameters
(append '((parent-frame .nil)) vertico-posframe-parameters)))
;; Clean up any experimental advices/handlers from previous turns
(advice-remove'posframe--create-posframe#'+posframe--create-posframe-around-a)
(advice-remove'set-frame-parameter#'+set-frame-parameter-around-a)
(setq posframe-arghandler nil)
;; Enable it via multiform for better control
(after! vertico
(vertico-multiform-mode 1)
;; Configure display modes for different commands
(setq vertico-multiform-commands
(if IS-MAC
'((t posframe))
'((consult-line posframe)))))
(vertico-posframe-mode 1))
(map! :leader
(:when (modulep! :completion vertico)
:desc"M-x""SPC"#'execute-extended-command))
Consult
(after! consult
(setq consult-preview-key nil))
Affe
(use-package! affe
:config;; Tell Affe to use the Orderless compiler for fuzzy matching
(defunaffe-orderless-regexp-compiler (input_type_ignorecase)
(setq input (cdr (orderless-compile input)))
(cons input (apply-partially#'orderless--highlight input t)))
(setq affe-regexp-compiler #'affe-orderless-regexp-compiler)
;; (Optional) Customize the search command. ;; By default, Affe will use 'find' and 'grep', but 'fd' and 'ripgrep' are much faster.
(setq affe-find-command "fd --color=never --type f --hidden --exclude .git")
(map! :leader:desc"Asynchronous fuzzy find""f F"#'affe-find:desc"Asynchronous grep""s g"#'affe-grep))
;; Fix for transient error on some Emacs versions
(unless (boundp'overriding-text-conversion-style)
(defvaroverriding-text-conversion-stylenil))
(after! magit
;; By default a thin line whose color indicates the transient-ness of the;; menu is used. Without an echo area that would look odd and below we;; color the border instead.
(setq transient-mode-line-format nil)
(setq transient-display-buffer-action
(list
(lambda (buffer_)
(posframe-show
buffer
:poshandler#'posframe-poshandler-frame-center;; To reduce the likelyhood of horizontal resizing, use the;; same minimal width as transient uses by default. It matches;; the width needed to display the commands common to all menus.:min-width transient-minimal-frame-width
;; If the parent frame is small, there might not be enough room.;; By default posframe wraps lines, but we truncate instead.:lines-truncatet;; Enable the fringe, so that we can see when truncation has;; occured. Hm, actually that's not good enough, so let's not.;; :right-fringe 8;;;; Indicate transient-ness of the menu. You could also use a;; constant color, if you don't care about this.:internal-border-color (transient--prefix-color)
:internal-border-width1)
;; `posframe-show' it not suitable for use as a display action;; and it appears posframe does not provide some other function;; that is. We can make this more complient by at least;; returning the used window.
(get-buffer-window transient--buffer t)))))
(after! transient
(transient-define-prefix dispatch-goto-menu () "This isn't documentation"
[["Move"
("b""bottom" end-of-buffer)
("g""top" beginning-of-buffer)
("d""definition (xref)" xref-find-definitions)
("h""beginning of line" beginning-of-line)
("e""end of line" end-of-line)
("s""first non-blank-line" beginning-of-line-text)]
["Buffer"
("n""next buffer" next-buffer)
("p""previous buffer" previous-buffer)
("B""bury buffer" bury-buffer)
("U""unbury buffer" unbury-buffer)
"Avy"
("c""goto char" avy-goto-char)
("l""got line" avy-goto-line)]
]))