Enable Company idle suggestions in text modes

This commit is contained in:
contrapunctus 2022-02-18 20:51:30 +05:30
parent 80a0460fc3
commit 9d0d04cee4
1 changed files with 11 additions and 4 deletions

View File

@ -3410,14 +3410,21 @@ But with =initials=, the desired completion is often buried in the results. That
"Adjust the font settings of FRAME so Emacs can display emoji properly."
(set-fontset-font t 'symbol (font-spec :family "Symbola") frame 'prepend))
(defun my-company-idle ()
"Enable `company-idle-delay' in the current buffer."
;; (make-local-variable 'company-idle-delay)
(with-current-buffer (current-buffer)
(setq-local company-idle-delay 0.2)))
(use-package company-emoji
:ensure t
:hook
(text-mode . company-mode)
(text-mode . company-emoji-init)
:init (--set-emoji-font nil) ;; For when Emacs is started in GUI mode:
(add-hook 'after-make-frame-functions '--set-emoji-font) ;; Hook for when a frame is created with emacsclient
:config (add-to-list 'company-backends 'company-emoji))
(text-mode . my-company-idle)
:init
(company-emoji-init)
(--set-emoji-font nil) ;; For when Emacs is started in GUI mode:
(add-hook 'after-make-frame-functions '--set-emoji-font)) ;; Hook for when a frame is created with emacsclient
#+END_SRC
** company-prescient