confi-emacs-actual/configs/base-extensions.el

314 lines
8.7 KiB
EmacsLisp
Raw Normal View History

;;; base-extensions.el --- Extensiones/paquetes instalados y su configuración -*- lexical-binding: t -*-
2022-03-30 01:21:13 +02:00
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;;; Code:
2022-05-16 06:13:25 +02:00
;; Iconos principalmente para ser usados por neotree
2022-05-27 23:04:28 +02:00
(use-package all-the-icons
:defer t
:straight t)
2022-05-16 06:13:25 +02:00
;; Reemplazar mejorado
2022-05-16 06:13:25 +02:00
(use-package anzu
:defer
2022-05-16 06:13:25 +02:00
:ensure t
2022-05-27 23:04:28 +02:00
:straight t
:hook (after-init . global-anzu-mode)
2022-05-16 06:13:25 +02:00
:config
(global-set-key [remap query-replace] 'anzu-query-replace)
(global-set-key [remap query-replace-regexp] 'anzu-query-replace-regexp))
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; Un bonito y sencillo panel de inicio
(use-package dashboard
2022-05-04 05:25:07 +02:00
:defer t
2022-05-27 23:04:28 +02:00
:straight t
:hook (after-init . dashboard-setup-startup-hook)
2022-03-30 01:21:13 +02:00
:config
2022-05-16 06:13:25 +02:00
(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)
))
)
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; Mover líneas o regiones
(use-package drag-stuff
2022-05-04 05:25:07 +02:00
:defer t
2022-05-27 23:04:28 +02:00
:straight t
:hook
(after-init . drag-stuff-global-mode)
2022-03-30 01:21:13 +02:00
:config
2022-05-16 06:13:25 +02:00
(drag-stuff-define-keys))
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; La línea bonita esa de abajo
(use-package doom-modeline
2022-05-04 05:25:07 +02:00
:defer t
2022-05-27 23:04:28 +02:00
:straight t
:ensure t
:hook (after-init . doom-modeline-mode)
: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
2022-05-16 06:13:25 +02:00
doom-modeline-persp-name t))
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; Emmet - Una ayuda para escribir HTML rápidamente (escribre doc, luego preciona C-j y lo entenderás)
(use-package emmet-mode
:defer t
2022-05-27 23:04:28 +02:00
:straight t
2022-05-16 06:13:25 +02:00
:hook (html-mode . emmet-mode))
2022-05-16 06:13:25 +02:00
;; Revisar sintaxis en vivo
(use-package flycheck
;; :diminish flycheck-mode
2022-04-05 04:08:30 +02:00
:defer t
2022-05-27 23:04:28 +02:00
:straight t
2022-05-16 06:13:25 +02:00
:hook (after-init . global-flycheck-mode) ; Habilitar flycheck en todos los modos
2022-03-30 01:21:13 +02:00
)
2022-05-16 06:13:25 +02:00
;; Mostrar los errores de flycheck en un pop up
(use-package flycheck-popup-tip
2022-04-06 07:32:38 +02:00
:defer t
2022-05-27 23:04:28 +02:00
:straight t
2022-05-16 06:13:25 +02:00
:hook (flycheck-mode . flycheck-popup-tip-mode))
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; Git Gutter - Marca a la izq. si una linea ha sido agregada, editada o eliminada desde el último commit.
(use-package git-gutter
2022-04-05 04:08:30 +02:00
:defer t
2022-05-27 23:04:28 +02:00
:straight t
2022-03-30 01:21:13 +02:00
:hook
(after-init . global-git-gutter-mode))
2022-03-30 01:21:13 +02:00
;; Highlight en los números.
;; (use-package highlight-numbers
;; :defer t
;; :straight t
;; :ensure t
;; :hook
;; (prog-mode . highlight-numbers-mode))
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; Magia para git
2022-05-27 23:04:28 +02:00
(use-package magit
:defer t
:straight t)
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; Modo markdown
2022-05-27 23:04:28 +02:00
(use-package markdown-mode
:defer t
:straight t)
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; Multiple vterm
(use-package multi-vterm
:defer t
:straight t
:bind* (("C-x tt" . multi-vterm-dedicated-toggle)
("C-x tf" . multi-vterm)
("C-x tp" . multi-vterm-project)
;;("<tab>" . vterm-send-tab)
)
:ensure t)
;; Mecanografía
(use-package speed-type
:straight t
:diminish
:config
(setq speed-type-gb-book-list '(46201 66867 66866 66591 57303 49063 13608 16132 17974 28430 59797 28929)
speed-type-min-chars 500
speed-type-max-chars 600))
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; Code Folding
(use-package origami
2022-04-05 04:08:30 +02:00
:defer t
2022-05-27 23:04:28 +02:00
:straight t
:bind (("C-<tab>" . origami-toggle-node)
("C-<iso-lefttab>" . origami-toggle-all-nodes))
:hook
(after-init . global-origami-mode))
;; Pomodoro en emacs :D
(use-package pomidor
:defer t
:straight t
:bind ("<f12>" . pomidor)
2022-05-16 06:13:25 +02:00
:init
;; (setq alert-default-style 'mode-line)
(setq alert-default-style 'libnotify)
(with-eval-after-load 'all-the-icons
(setq alert-severity-faces
'((urgent . all-the-icons-red)
(high . all-the-icons-orange)
(moderate . all-the-icons-yellow)
(normal . all-the-icons-green)
(low . all-the-icons-blue)
(trivial . all-the-icons-purple))
alert-severity-colors
`((urgent . ,(face-foreground 'all-the-icons-red))
(high . ,(face-foreground 'all-the-icons-orange))
(moderate . ,(face-foreground 'all-the-icons-yellow))
(normal . ,(face-foreground 'all-the-icons-green))
(low . ,(face-foreground 'all-the-icons-blue))
(trivial . ,(face-foreground 'all-the-icons-purple)))))
;; (setq pomidor-sound-tick nil
;; pomidor-sound-tack nil) ; Deshabilitar el sonido de reloj de pomidor
(setq pomidor-play-sound-file
(lambda (file)
(start-process "pomidor-play-sound"
nil
"playsound"
file)))
)
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; Paquete para manejo de proyectos
2022-03-30 01:21:13 +02:00
(use-package projectile
2022-05-04 05:25:07 +02:00
:defer t
2022-05-27 23:04:28 +02:00
:straight t
:bind ("C-c p" . projectile-command-map)
2022-03-30 01:21:13 +02:00
:diminish projectile-mode
:custom ((projectile-completion-system 'ivy))
:hook (after-init . projectile-mode)
2022-03-30 01:21:13 +02:00
:init
(setq projectile-mode-line-prefix ""
projectile-sort-order 'recentf
projectile-use-git-grep t)
:config
2022-03-30 01:21:13 +02:00
;; 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 inicio).
2022-03-30 01:21:13 +02:00
(when (file-directory-p "~/Proyectos")
(setq projectile-project-search-path '("~/Proyectos")))
2022-05-04 05:25:07 +02:00
(when (file-directory-p "~/mnt/Nginx")
2022-03-30 01:21:13 +02:00
(setq projectile-project-search-path (append
projectile-project-search-path
2022-05-04 05:25:07 +02:00
'("~/mnt/Nginx"))))
2022-03-30 01:21:13 +02:00
(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")
)
)
2022-05-16 06:13:25 +02:00
;; Recentf - Guarda registro de los archivos abiertos recientemente
(use-package recentf
2022-05-04 05:25:07 +02:00
:defer t
2022-05-27 23:04:28 +02:00
:straight t
:bind ("C-x C-r" . recentf-open-files)
2022-03-30 01:21:13 +02:00
:config
2022-05-16 06:13:25 +02:00
(setq recentf-save-file
(recentf-expand-file-name (concat temp-dir "/recentf")))
(recentf-mode 1))
2022-03-30 01:21:13 +02:00
;; Busqueda rápida con ripgrep
(use-package rg
:defer t
:straight t
:defines projectile-command-map
:hook (after-init . rg-enable-default-bindings)
:bind (:map rg-global-map
("c" . rg-dwim-current-dir)
("f" . rg-dwim-current-file)
("m" . rg-menu))
:init (setq rg-group-result t
rg-show-columns t)
:config
(cl-pushnew '("tmpl" . "*.tmpl") rg-custom-type-aliases)
(with-eval-after-load 'projectile
(bind-key "s R" #'rg-project projectile-command-map)))
2022-05-16 06:13:25 +02:00
;; Guardar la posición del cursor en un archivo para volver allí cuando se lo vuelva a abrir.
(use-package saveplace
2022-04-05 04:08:30 +02:00
:defer t
2022-05-27 23:04:28 +02:00
:straight t
:hook (after-init . save-place-mode)
2022-03-30 01:21:13 +02:00
:config
2022-05-16 06:13:25 +02:00
(setq save-place-file (locate-user-emacs-file (concat temp-dir "/places"))))
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; Autocompletado de parentesis, corchetes, llaves, etc.
(use-package smartparens
2022-05-04 05:25:07 +02:00
:defer t
2022-05-27 23:04:28 +02:00
:straight t
:hook (after-init . smartparens-global-mode))
2022-05-16 06:13:25 +02:00
;; Mejorando el scroll
(use-package smooth-scrolling
:defer t
2022-05-27 23:04:28 +02:00
:straight t
:hook (after-init . smooth-scrolling-mode)
2022-03-30 01:21:13 +02:00
:config
2022-05-16 06:13:25 +02:00
(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)
)
2022-03-30 01:21:13 +02:00
(use-package tree-sitter
:defer t
:straight t
:hook (after-init . global-tree-sitter-mode)
:config
(add-to-list 'tree-sitter-major-mode-language-alist '(rustic-mode . rust))
)
(use-package tree-sitter-langs
:straight t
:after tree-sitter)
2022-05-16 06:13:25 +02:00
;; Terminal
2022-05-27 23:04:28 +02:00
(use-package vterm :ensure t :defer t :straight t)
2022-03-30 01:21:13 +02:00
;; Cuando iniicias un atajo de teclas te muestra las posibilidades
2022-05-16 06:13:25 +02:00
(use-package which-key
:defer t
2022-05-27 23:04:28 +02:00
:straight t
:hook (after-init . which-key-mode))
2022-03-30 01:21:13 +02:00
2022-05-16 06:13:25 +02:00
;; Restaurar el estado de los frames
(use-package winner
:defer t
2022-05-27 23:04:28 +02:00
:straight t
:hook (after-init . winner-mode))
2022-05-04 05:25:07 +02:00
;; Permitir snippets
2022-05-16 06:13:25 +02:00
(use-package yasnippet
:defer t
2022-05-27 23:04:28 +02:00
:straight t
2022-05-16 06:13:25 +02:00
:ensure t
:custom
(yas-prompt-functions '(yas-completing-prompt))
:hook
((prog-mode feature-mode) . yas-minor-mode-on)
(html-mode . yas-minor-mode))
;; Coleción de snippets
2022-05-27 23:04:28 +02:00
(use-package yasnippet-snippets
:ensure t
:defer t
:straight t)
2022-05-04 05:25:07 +02:00
(use-package esup
:ensure t
:straight t)
2022-03-30 01:21:13 +02:00
(provide 'base-extensions)
;;; base-extensions.el ends here