2022-11-19 04:33:22 +01:00
|
|
|
;;; init-company.el --- Autocompletado con company-mode -*- lexical-binding: t -*-
|
2022-06-01 15:18:06 +02:00
|
|
|
|
|
|
|
;; Author: kj <webmaster@outcontrol.net>
|
|
|
|
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
2023-04-14 18:39:19 +02:00
|
|
|
;; Archivo de configuración específico para el paquete company.
|
|
|
|
;; Company, de manera resumida, es el que nos muestra el autocompletado
|
|
|
|
;; en Emacs, tanto para código como para otro tipo de textos.
|
|
|
|
|
2022-06-01 15:18:06 +02:00
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(use-package company
|
|
|
|
:defer t
|
|
|
|
:straight t
|
|
|
|
:defines (company-dabbrev-ignore-case company-dabbrev-downcase)
|
|
|
|
:custom-face
|
|
|
|
(company-box-selection ((t (:inherit company-tooltip :weight semibold :extend t))))
|
|
|
|
:hook (after-init . global-company-mode)
|
|
|
|
:bind (
|
|
|
|
:map company-active-map
|
|
|
|
("<tab>" . company-indent-or-complete-common) ; Completar con tab como en la terminal de linux
|
|
|
|
("<escape>" . company-abort) ; Cerrar company con ESC
|
|
|
|
)
|
2023-04-13 09:28:20 +02:00
|
|
|
:config
|
2022-06-01 15:18:06 +02:00
|
|
|
(setq company-tooltip-align-annotations t
|
|
|
|
company-tooltip-limit 12
|
2022-06-08 08:49:56 +02:00
|
|
|
company-idle-delay 0.5 ; mostrar autocompletado luego de medio segundo mostrar
|
2022-06-01 15:18:06 +02:00
|
|
|
company-echo-delay (if (display-graphic-p) nil 0)
|
|
|
|
company-minimum-prefix-length 1 ; mostrar autocompletado desde que se coloca la primera letra.
|
|
|
|
company-icon-margin 3
|
|
|
|
company-require-match nil
|
|
|
|
company-dabbrev-ignore-case nil
|
|
|
|
company-dabbrev-downcase nil ; autocompletado case-sensitive.
|
|
|
|
company-global-modes '(not erc-mode message-mode help-mode
|
2022-11-29 08:45:09 +01:00
|
|
|
gud-mode eshell-mode shell-mode))
|
2023-04-13 09:28:20 +02:00
|
|
|
(add-to-list 'company-backends 'company-paths)
|
|
|
|
)
|
2022-06-01 15:18:06 +02:00
|
|
|
|
2023-04-13 09:28:20 +02:00
|
|
|
;; Rutas en company
|
|
|
|
(use-package company-paths
|
|
|
|
:straight (company-paths :type git :host github :repo "emacs-vs/company-paths")
|
2022-06-01 15:18:06 +02:00
|
|
|
:defer t
|
2023-04-13 09:28:20 +02:00
|
|
|
:after (company-mode)
|
|
|
|
)
|
2022-06-01 15:18:06 +02:00
|
|
|
|
|
|
|
;; Hacer que el autocompletado se vea más bonito con íconos
|
|
|
|
(use-package company-box
|
|
|
|
:defer t
|
|
|
|
:straight t
|
|
|
|
:diminish
|
|
|
|
:hook (company-mode . company-box-mode)
|
2023-04-13 09:28:20 +02:00
|
|
|
:config
|
|
|
|
(setq company-box-backends-colors nil
|
2022-06-01 15:18:06 +02:00
|
|
|
company-box-doc-delay 0.1
|
|
|
|
company-box-scrollbar 'right)
|
2023-04-13 09:28:20 +02:00
|
|
|
)
|
2022-06-01 15:18:06 +02:00
|
|
|
|
2022-11-19 04:33:22 +01:00
|
|
|
(provide 'init-company)
|
|
|
|
;;; init-company.el ends here
|