2023-05-02 06:32:14 +02:00
|
|
|
;;; init-corfu.el --- Autocompletado con corfu -*- lexical-binding: t -*-
|
|
|
|
|
|
|
|
;; Author: kj <webmaster@outcontrol.net>
|
|
|
|
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;; Archivo de configuración específico para el paquete corfu.
|
|
|
|
;; Corfu, de manera resumida, es el que nos muestra el autocompletado
|
|
|
|
;; en Emacs, tanto para código como para otro tipo de textos.
|
|
|
|
;;
|
|
|
|
;; Este paquete viene a ser una alternativa a Company, por lo
|
|
|
|
;; que no se deberían activar los 2 al mismo tiempo.
|
|
|
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(use-package corfu
|
|
|
|
:defer t
|
2023-09-16 20:05:56 +02:00
|
|
|
:elpaca (:files (:defaults "extensions/*")
|
2023-05-02 06:32:14 +02:00
|
|
|
:includes (corfu-info corfu-history))
|
|
|
|
:hook ((after-init . global-corfu-mode)
|
|
|
|
(corfu-mode . corfu-popupinfo-mode))
|
|
|
|
:bind (("<escape>" . corfu-quit)
|
|
|
|
("<SPC>" . corfu-insert-separator)
|
|
|
|
:map corfu-map
|
|
|
|
([tab] . nil))
|
|
|
|
:custom
|
|
|
|
(corfu-auto t)
|
|
|
|
:config
|
|
|
|
(setq corfu-popupinfo-delay 0
|
2023-09-01 03:21:24 +02:00
|
|
|
;; corfu-auto-delay 0.5
|
2023-05-02 06:32:14 +02:00
|
|
|
corfu-auto-prefix 1
|
|
|
|
corfu-cycle t
|
|
|
|
corfu-preview-current nil
|
|
|
|
corfu-quit-no-match t)
|
|
|
|
)
|
|
|
|
|
2023-08-26 20:10:20 +02:00
|
|
|
(use-package orderless
|
|
|
|
:defer t
|
|
|
|
:config
|
|
|
|
(setq completion-styles '(orderless basic)
|
|
|
|
completion-category-defaults nil
|
|
|
|
completion-category-overrides '((file (styles partial-completion)))))
|
|
|
|
|
2023-05-02 06:32:14 +02:00
|
|
|
(use-package cape
|
2023-09-16 20:05:56 +02:00
|
|
|
:elpaca (:host github :repo "minad/cape")
|
2023-05-02 06:32:14 +02:00
|
|
|
:after corfu
|
|
|
|
:init
|
|
|
|
;; (advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
|
|
|
|
(advice-add #'eglot-completion-at-point :around #'cape-wrap-nonexclusive)
|
|
|
|
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
|
|
|
|
(add-to-list 'completion-at-point-functions #'cape-file)
|
|
|
|
;; (add-to-list 'completion-at-point-functions #'cape-line)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Hacer que corfu funcione en la terminal
|
2023-06-23 11:31:48 +02:00
|
|
|
(unless (display-graphic-p)
|
|
|
|
(use-package corfu-terminal
|
2023-09-16 20:05:56 +02:00
|
|
|
:elpaca (:repo "https://codeberg.org/akib/emacs-corfu-terminal.git")
|
2023-06-23 11:31:48 +02:00
|
|
|
:config
|
2023-05-02 06:32:14 +02:00
|
|
|
(corfu-terminal-mode +1))
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Iconos en corfu
|
|
|
|
(use-package kind-icon
|
|
|
|
:ensure t
|
|
|
|
:after corfu
|
|
|
|
:custom
|
|
|
|
(kind-icon-default-face 'corfu-default) ; to compute blended backgrounds correctly
|
|
|
|
:config
|
|
|
|
(add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))
|
|
|
|
|
|
|
|
|
|
|
|
(provide 'init-corfu)
|
|
|
|
;;; init-corfu.el ends here
|