Compare commits

..

3 Commits

Author SHA1 Message Date
kj
023f11c25e Add corfu config (replacement for company). 2023-05-02 00:32:14 -04:00
kj
6cda0d1d5e Remove unused and commented package. 2023-05-02 00:30:53 -04:00
kj
6364157efd remove fymake legacy hook. 2023-05-02 00:29:31 -04:00
3 changed files with 75 additions and 7 deletions

71
configs/init-corfu.el Normal file
View File

@ -0,0 +1,71 @@
;;; 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
:straight (corfu :files (:defaults "extensions/*")
: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
corfu-auto-prefix 1
corfu-cycle t
corfu-preview-current nil
corfu-quit-no-match t)
)
(use-package cape
:straight (cape :type git :host github :repo "minad/cape")
: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
(use-package corfu-terminal
:straight (corfu-terminal :type git :repo "https://codeberg.org/akib/emacs-corfu-terminal.git")
:defer t
:after corfu
:config
(unless (display-graphic-p)
(corfu-terminal-mode +1))
)
;; Iconos en corfu
(use-package kind-icon
:ensure t
:straight 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

View File

@ -64,6 +64,8 @@
:hook (prog-mode . (lambda ()
(unless (derived-mode-p 'makefile-mode)
(flymake-mode))))
:config
(remove-hook 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake)
)
;; Mostar los errores de flymake en un popup-tip
@ -73,11 +75,5 @@
:after flymake
:hook (flymake-mode . flymake-diagnostic-at-point-mode))
;; Mostrar eldoc en un popup
;; (use-package eldoc-box
;; :defer t
;; :straight t
;; :hook (eldoc-mode-hook . eldoc-box-hover-at-point-mode ))
(provide 'init-eglot)
;;; init-eglot.el ends here

View File

@ -20,7 +20,8 @@
(require 'init-org)
;; (require 'init-lsp)
(require 'init-eglot)
(require 'init-company)
;; (require 'init-company)
(require 'init-corfu)
(require 'init-treemacs)
(require 'init-ctags)
(require 'init-minibuffer)