287 lines
7.9 KiB
EmacsLisp
287 lines
7.9 KiB
EmacsLisp
;;; base-extensions.el --- Extenciones/paquetes instalados y su configuración
|
|
|
|
;; Author: kj <webmaster@outcontrol.net>
|
|
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
|
|
|
;;; Commentary:
|
|
|
|
;;; Code:
|
|
|
|
;; use-package - No necesita presentación
|
|
(use-package use-package :defer t)
|
|
|
|
;; Auto-actualizar los paquetes
|
|
(use-package auto-package-update
|
|
:defer t
|
|
:custom
|
|
(auto-package-update-interval 7)
|
|
(auto-package-update-prompt-before-update t)
|
|
(auto-package-update-hide-results t)
|
|
:config
|
|
(auto-package-update-at-time "06:00")
|
|
:init
|
|
(setq
|
|
auto-package-update-last-update-day-filename
|
|
(expand-file-name ".last-package-update-day" private-dir)))
|
|
|
|
;; Iconos principalmente para ser usados por neotree
|
|
(use-package all-the-icons :defer t)
|
|
|
|
;; Terminal
|
|
(use-package vterm :ensure t :defer t)
|
|
|
|
;; Multiple vterm
|
|
(use-package multi-vterm :ensure t :defer t)
|
|
|
|
;; Highlight en los números.
|
|
(use-package highlight-numbers
|
|
:defer t
|
|
:ensure t
|
|
:hook
|
|
(prog-mode . highlight-numbers-mode))
|
|
|
|
;; Mover líneas o regiones
|
|
(use-package drag-stuff
|
|
:defer t
|
|
:config
|
|
(drag-stuff-define-keys))
|
|
|
|
;; Recentf - Guarda registro de los archivos abiertos recientemente
|
|
(use-package recentf
|
|
:defer t
|
|
:config
|
|
(setq recentf-save-file
|
|
(recentf-expand-file-name (concat temp-dir "/recentf")))
|
|
(recentf-mode 1))
|
|
|
|
|
|
;; Guardar la posición del cursor en un archivo para volver allí cuando se lo vuelva a abrir.
|
|
(use-package saveplace
|
|
:defer t
|
|
:config
|
|
(setq save-place-file (locate-user-emacs-file (concat temp-dir "/places"))))
|
|
|
|
;; Emmet - Una ayuda para escribir HTML rápidamente (escribre doc, luego preciona C-j y lo entenderás)
|
|
(use-package emmet-mode
|
|
:hook (html-mode . emmet-mode))
|
|
|
|
;; Modo markdown
|
|
(use-package markdown-mode :defer t)
|
|
|
|
;; Git Gutter - Marca a la izq. si una linea ha sido agregada, editada o eliminada desde el último commit.
|
|
(use-package git-gutter :defer t)
|
|
|
|
;; Mejorando el scroll
|
|
(use-package smooth-scrolling
|
|
:defer t
|
|
:config
|
|
(setq mouse-wheel-scroll-amount
|
|
'(8 ((shift) . 1) ((control) . nil))) ; Cambia el scroll a 8 líneas a la vez, 1 cuando se preciona SHIFT y saltos de página cuando presionas CTRL
|
|
(setq mouse-wheel-progressive-speed nil) ; Deshabilita la velocidad progresiva del scroll (mientras más scroll haces, mas rápido va)
|
|
)
|
|
|
|
(use-package doom-modeline
|
|
:defer t
|
|
:ensure t
|
|
:init (doom-modeline-mode 1)
|
|
:config
|
|
(setq doom-modeline-project-detection 'auto
|
|
doom-modeline-buffer-file-name-style 'relative-from-project
|
|
doom-modeline-major-mode-color-icon t
|
|
doom-modeline-buffer-modification-icon t
|
|
doom-modeline-indent-info nil
|
|
doom-modeline-persp-name t)
|
|
)
|
|
|
|
;; Code Folding
|
|
(use-package origami :defer t)
|
|
|
|
;; Reemplazar y buscar menjorado
|
|
(use-package anzu
|
|
:ensure t
|
|
:config
|
|
(global-anzu-mode +1)
|
|
(global-set-key [remap query-replace] 'anzu-query-replace)
|
|
(global-set-key [remap query-replace-regexp] 'anzu-query-replace-regexp))
|
|
|
|
;; Automcompletado
|
|
(use-package company
|
|
:defer t
|
|
:config
|
|
(global-company-mode)
|
|
(setq company-dabbrev-downcase nil) ; autocompletado case-sensitive.
|
|
(setq company-idle-delay 0) ; mostrar autocompletado lo más rápido posible
|
|
(setq company-minimum-prefix-length 1) ; mostrar autocompletado desde que se coloca la primera letra.
|
|
(setq company-backends '((company-files :with company-yasnippet)
|
|
(company-capf :with company-yasnippet)
|
|
(company-dabbrev-code company-ctags company-keywords :with company-yasnippet)
|
|
(company-dabbrev :with company-yasnippet)))
|
|
)
|
|
|
|
;; Poner la info acerca del autocompletado del autocompletado mas rápido
|
|
(use-package company-quickhelp
|
|
:defer t
|
|
:ensure t
|
|
:custom
|
|
(company-quickhelp-delay 2)
|
|
(company-quickhelp-mode))
|
|
|
|
;; Hacer que el autocompletado se vea más bonito con íconos
|
|
(use-package company-box
|
|
:defer t
|
|
:hook (company-mode . company-box-mode))
|
|
|
|
;; Usar autocompletado con ctags y company
|
|
(use-package company-ctags :defer t)
|
|
|
|
;; Snippets
|
|
(use-package yasnippet
|
|
:defer t
|
|
:ensure t
|
|
:custom
|
|
(yas-prompt-functions '(yas-completing-prompt))
|
|
:config
|
|
(yas-reload-all)
|
|
:hook
|
|
((prog-mode feature-mode) . yas-minor-mode-on)
|
|
(html-mode . yas-minor-mode))
|
|
|
|
(use-package yasnippet-snippets :ensure t :defer t)
|
|
|
|
;; Restaurar el estado de los frames
|
|
(use-package winner
|
|
:defer t
|
|
:init
|
|
(winner-mode 1))
|
|
|
|
(use-package lsp-mode
|
|
:defer t
|
|
;; :hook (js-mode . lsp-deferred)
|
|
:custom
|
|
(lsp-headerline-breadcrumb-enable nil))
|
|
|
|
(use-package lsp-ui :defer t)
|
|
|
|
;; Revisar sintaxis en vivo
|
|
(use-package flycheck
|
|
;; :diminish flycheck-mode
|
|
:defer t
|
|
:hook (after-init . global-flycheck-mode) ; Habilitar flycheck en todos los modos
|
|
)
|
|
|
|
;; Mostrar los errores de flycheck en un pop up
|
|
(use-package flycheck-popup-tip
|
|
:defer t
|
|
:hook (flycheck-mode . flycheck-popup-tip-mode))
|
|
|
|
;; Un bonito y sencillo panel de inicio
|
|
(use-package dashboard
|
|
:defer t
|
|
:config
|
|
(setq dashboard-set-file-icons t)
|
|
(setq dashboard-set-heading-icons t)
|
|
(setq dashboard-set-file-icons t)
|
|
(setq dashboard-startup-banner
|
|
(expand-file-name "duck-small.png" user-emacs-directory))
|
|
(setq dashboard-items '(
|
|
(agenda . 10)
|
|
(recents . 10)
|
|
))
|
|
)
|
|
|
|
;; Autocompletado para shell scripting.
|
|
(use-package company-shell
|
|
:defer t
|
|
:config
|
|
(add-to-list 'company-backends '(company-shell company-shell-env company-fish-shell))
|
|
)
|
|
|
|
;; Autocompletado para el minibuffer (counsel e ivy)
|
|
(use-package counsel :defer t)
|
|
|
|
(use-package projectile
|
|
:defer t
|
|
:diminish projectile-mode
|
|
:config
|
|
(projectile-mode)
|
|
:custom ((projectile-completion-system 'ivy))
|
|
:init
|
|
;; Rutas de archivos temporales.
|
|
(setq projectile-cache-file (expand-file-name "projectile.cache" temp-dir))
|
|
(setq projectile-known-projects-file (expand-file-name
|
|
"projectile-bookmarks.eld" temp-dir))
|
|
;; Carpetas donde tienes tus proyectos (deben tener un archivo .projectile o un repro git iniciado).
|
|
(when (file-directory-p "~/Proyectos")
|
|
(setq projectile-project-search-path '("~/Proyectos")))
|
|
(when (file-directory-p "~/mnt/Nginx")
|
|
(setq projectile-project-search-path (append
|
|
projectile-project-search-path
|
|
'("~/mnt/Nginx"))))
|
|
(setq projectile-switch-project-action #'projectile-dired) ; Usar dired cuando se elija un proyecto.
|
|
|
|
;; Cambiar el título de la ventana de emacs
|
|
(setq frame-title-format
|
|
'(
|
|
(:eval
|
|
(let ((project-name (projectile-project-name)))
|
|
(unless (string= "-" project-name)
|
|
(format "[%s] " project-name))))
|
|
"%b"
|
|
" - Emacs")
|
|
)
|
|
)
|
|
|
|
;; Autocompletado de proyectos en counsel (projectile)
|
|
(use-package counsel-projectile
|
|
:defer t
|
|
:config
|
|
(counsel-projectile-mode))
|
|
|
|
;; Mostrar info del panel inferior de otra manera
|
|
(use-package ivy
|
|
:defer t
|
|
:config
|
|
(ivy-mode 1)
|
|
(setq ivy-use-virtual-buffers nil)
|
|
)
|
|
|
|
;; Iconos en Ivy (allthe icons)
|
|
(use-package all-the-icons-ivy-rich
|
|
:defer t
|
|
:ensure t
|
|
:config
|
|
(setq all-the-icons-ivy-rich-color-icon t))
|
|
|
|
(use-package ivy-rich
|
|
:ensure t
|
|
:defer t)
|
|
|
|
;; Cuando iniicias un atajo de teclas te muestra las posibilidades
|
|
(use-package which-key :defer t)
|
|
|
|
;; Autocompletado de parentesis, corchetes, llaves, etc.
|
|
(use-package smartparens :defer t)
|
|
|
|
;; Magia para git
|
|
(use-package magit :defer t)
|
|
|
|
;; Auto-inicios de major y minor modes afuera para poder hacer defer
|
|
(smooth-scrolling-mode 1)
|
|
(auto-package-update-maybe)
|
|
(drag-stuff-global-mode 1)
|
|
(save-place-mode 1)
|
|
(global-git-gutter-mode +1)
|
|
(dashboard-setup-startup-hook)
|
|
(global-origami-mode)
|
|
(ivy-rich-mode 1)
|
|
(all-the-icons-ivy-rich-mode 1)
|
|
(which-key-mode)
|
|
(smartparens-global-mode t)
|
|
(setq use-package-always-ensure t) ; auto-instalar paquetes que no estésn instalados
|
|
|
|
;; Org-Mode
|
|
(require 'org-config)
|
|
|
|
(provide 'base-extensions)
|
|
;;; base-extensions.el ends here
|