doomemacs/modules/ui/posframe/config.el

57 lines
2 KiB
EmacsLisp
Raw Normal View History

2018-03-12 12:47:26 -04:00
;;; ui/posframe/config.el -*- lexical-binding: t; -*-
(def-package! posframe
:defer t
:config
(add-hook 'doom-cleanup-hook #'posframe-delete-all)
(add-hook 'doom-escape-hook #'+posframe|delete-on-escape))
2018-03-12 12:47:26 -04:00
(def-package! company-childframe
:when (featurep! :completion company)
:when EMACS26+
2018-03-12 12:47:26 -04:00
:after company
:config
(setq company-childframe-notification nil)
2018-03-12 12:47:26 -04:00
(company-childframe-mode 1)
(after! desktop
(push '(company-childframe-mode . nil) desktop-minor-mode-table)))
(def-package! ivy-posframe
:when (featurep! :completion ivy)
:when EMACS26+
2018-03-12 12:47:26 -04:00
:after ivy
:preface
;; This function searches the entire `obarray' just to populate
;; `ivy-display-functions-props'. There are 15k entries in mine! This is
;; wasteful, so...
(advice-add #'ivy-posframe-setup :override #'ignore)
:config
;; ... let's do it manually
(dolist (fn (list 'ivy-posframe-display-at-frame-bottom-left
'ivy-posframe-display-at-frame-center
'ivy-posframe-display-at-point
'ivy-posframe-display-at-frame-bottom-window-center
'ivy-posframe-display
'ivy-posframe-display-at-window-bottom-left
'ivy-posframe-display-at-window-center
'+posframe-ivy-display-at-frame-center-near-bottom))
(push (list fn :cleanup 'ivy-posframe-cleanup) ivy-display-functions-props))
(push '(t . +posframe-ivy-display-at-frame-center-near-bottom) ivy-display-functions-alist)
2018-03-14 04:49:14 -04:00
;; posframe doesn't work well with async sources
(dolist (fn '(swiper counsel-rg counsel-ag counsel-pt counsel-grep counsel-git-grep))
(push (cons fn nil) ivy-display-functions-alist))
2018-03-12 12:47:26 -04:00
(ivy-posframe-enable)
(setq ivy-height 16
ivy-fixed-height-minibuffer nil
ivy-posframe-parameters `((min-width . 90)
(min-height . ,ivy-height)
(internal-border-width . 10))))
2018-03-12 12:47:26 -04:00
;; TODO helm-posframe?