confi-emacs-actual/configs/base-extensions.el
2022-08-07 12:14:12 -04:00

341 lines
9.5 KiB
EmacsLisp

;;; base-extensions.el --- Extensiones/paquetes instalados y su configuración -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;;; Code:
;; Iconos principalmente para ser usados por neotree
(use-package all-the-icons
:defer t
:straight t)
;; Reemplazar mejorado
(use-package anzu
:defer
:ensure t
:straight t
:hook (after-init . global-anzu-mode)
:config
(global-set-key [remap query-replace] 'anzu-query-replace)
(global-set-key [remap query-replace-regexp] 'anzu-query-replace-regexp))
;; Un bonito y sencillo panel de inicio
(use-package dashboard
:defer t
:straight t
:hook (after-init . dashboard-setup-startup-hook)
:config
(setq dashboard-set-file-icons t
dashboard-set-heading-icons t
dashboard-set-file-icons t
dashboard-week-agenda nil
dashboard-agenda-time-string-format "%Y-%m-%d %H:%M")
(setq dashboard-startup-banner
(expand-file-name "duck-small.png" user-emacs-directory))
(setq dashboard-items '(
(agenda . 10)
;;(recents . 10)
))
)
;; Mover líneas o regiones
(use-package drag-stuff
:defer t
:straight t
:hook
(after-init . drag-stuff-global-mode)
:config
(drag-stuff-define-keys))
;; La línea bonita esa de abajo
(use-package doom-modeline
:defer t
: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
doom-modeline-persp-name t))
;; Emmet - Una ayuda para escribir HTML rápidamente (escribre doc, luego preciona C-j y lo entenderás)
(use-package emmet-mode
:defer t
:straight t
:hook (html-mode . emmet-mode))
;; Revisar sintaxis en vivo
(use-package flycheck
;; :diminish flycheck-mode
:defer t
:straight t
:hook (after-init . global-flycheck-mode) ; Habilitar flycheck de manera global
)
;; Mostrar los errores de flycheck en un pop up
(use-package flycheck-popup-tip
:defer t
:straight t
:hook (flycheck-mode . flycheck-popup-tip-mode))
;; 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
:straight t
:hook
(after-init . global-git-gutter-mode))
(use-package gcmh
:defer t
:straight t
:init
(setq gcmh-high-cons-threshold 100000000)
(gcmh-mode 1))
;; Highlight en los números.
;; (use-package highlight-numbers
;; :defer t
;; :straight t
;; :ensure t
;; :hook
;; (prog-mode . highlight-numbers-mode))
;; Magia para git
(use-package magit
:defer t
:straight t)
;; Modo markdown
(use-package markdown-mode
:defer t
:straight t)
;; 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 '(66867 66866 66591 57303)
speed-type-min-chars 500
speed-type-max-chars 600))
;; Code Folding
(use-package origami
:defer t
: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)
: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)))
)
;; Paquete para manejo de proyectos
(use-package projectile
:defer t
:straight t
:bind ("C-c p" . projectile-command-map)
:diminish projectile-mode
:custom ((projectile-completion-system 'ivy))
:hook (after-init . projectile-mode)
:init
(setq projectile-mode-line-prefix ""
projectile-sort-order 'recentf
projectile-use-git-grep t)
:config
;; 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).
(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")
)
)
;; Recentf - Guarda registro de los archivos abiertos recientemente
(use-package recentf
:defer t
:straight t
:bind ("C-x C-r" . recentf-open-files)
:config
(setq recentf-save-file
(recentf-expand-file-name (concat temp-dir "/recentf")))
(recentf-mode 1))
;; 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)))
;; Guardar la posición del cursor en un archivo para volver allí cuando se lo vuelva a abrir.
(use-package saveplace
:defer t
:straight t
:hook (after-init . save-place-mode)
:config
(setq save-place-file (locate-user-emacs-file (concat temp-dir "/places"))))
;; Autocompletado de parentesis, corchetes, llaves, etc.
(use-package smartparens
:defer t
:straight t
:hook (after-init . smartparens-global-mode))
;; Mejorando el scroll
(use-package smooth-scrolling
:defer t
:straight t
:hook (after-init . smooth-scrolling-mode)
: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 silicon
:ensure t
:straight (silicon :type git :host github :repo "iensu/silicon-el"))
(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)
;; Terminal
(use-package vterm :ensure t :defer t :straight t)
(use-package multi-web-mode
:straight t
:defer t
:hook (after-init . multi-web-global-mode)
:config
(setq mweb-default-major-mode 'html-mode)
(setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>")
(js-mode "<script +\\(type=\"text/javascript\"\\|language=\"javascript\"\\)[^>]*>" "</script>")
(css-mode "<style +type=\"text/css\"[^>]*>" "</style>")))
(setq mweb-filename-extensions '("php" "htm" "html")))
;; Cuando iniicias un atajo de teclas te muestra las posibilidades
(use-package which-key
:defer t
:straight t
:hook (after-init . which-key-mode))
;; Restaurar el estado de los frames
(use-package winner
:defer t
:straight t
:hook (after-init . winner-mode))
;; Permitir snippets
(use-package yasnippet
:defer t
:straight t
:ensure t
:bind (:map yas-minor-mode-map
("TAB" . nil)
("<tab>" . nil)) ;; unbid tab for yasnippets
: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
(use-package yasnippet-snippets
:ensure t
:defer t
:straight t)
(use-package esup
:ensure t
:straight t)
(provide 'base-extensions)
;;; base-extensions.el ends here