2020-08-10 03:09:34 +02:00
;Repositorio MELPA.
2020-08-02 07:57:21 +02:00
( require 'package )
( add-to-list 'package-archives ' ( " melpa " . " https://melpa.org/packages/ " ) )
2020-08-10 03:09:34 +02:00
;Directorio personalizado para mis themes.
2020-08-02 07:57:21 +02:00
( add-to-list 'custom-theme-load-path " ~/.emacs.d/themes/ " )
( package-initialize )
2020-08-10 03:09:34 +02:00
;Aquí vienen cosas de los themes y los paquetes.
2020-08-02 07:57:21 +02:00
( custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
' ( ansi-color-names-vector
[ " #212121 " " #CC5542 " " #6aaf50 " " #7d7c61 " " #5180b3 " " #DC8CC3 " " #9b55c3 " " #bdbdb3 " ] )
' ( compilation-message-face ( quote default ) )
' ( custom-enabled-themes ( quote ( dracula ) ) )
' ( custom-safe-themes
( quote
2020-10-06 10:55:59 +02:00
( " 24714e2cb4a9d6ec1335de295966906474fdb668429549416ed8636196cb1441 " " fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088 " " bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476 " " c7eb06356fd16a1f552cfc40d900fe7326ae17ae7578f0ef5ba1edd4fdd09e58 " " f3ab34b145c3b2a0f3a570ddff8fabb92dafc7679ac19444c31058ac305275e1 " " dcdd1471fde79899ae47152d090e3551b889edf4b46f00df36d653adc2bf550d " " 3994b1c5c1f412c025bb71b2df5973a421c257afee5278684639c205d79d93ee " default ) ) )
2020-08-02 07:57:21 +02:00
' ( fci-rule-color " #2e2e2e " )
' ( highlight-changes-colors ( quote ( " #FD5FF0 " " #AE81FF " ) ) )
' ( highlight-tail-colors
( quote
( ( " #3C3D37 " . 0 )
( " #679A01 " . 20 )
( " #4BBEAE " . 30 )
( " #1DB4D0 " . 50 )
( " #9A8F21 " . 60 )
( " #A75B00 " . 70 )
( " #F309DF " . 85 )
( " #3C3D37 " . 100 ) ) ) )
2020-08-02 08:33:44 +02:00
' ( hl-todo-keyword-faces
( quote
( ( " TODO " . " #dc752f " )
( " NEXT " . " #dc752f " )
( " THEM " . " #2d9574 " )
( " PROG " . " #4f97d7 " )
( " OKAY " . " #4f97d7 " )
( " DONT " . " #f2241f " )
( " FAIL " . " #f2241f " )
( " DONE " . " #86dc2f " )
( " NOTE " . " #b1951d " )
( " KLUDGE " . " #b1951d " )
( " HACK " . " #b1951d " )
( " TEMP " . " #b1951d " )
( " FIXME " . " #dc752f " )
( " XXX+ " . " #dc752f " )
( " \\ ? \\ ? \\ ?+ " . " #dc752f " ) ) ) )
2020-08-02 07:57:21 +02:00
' ( inhibit-startup-screen t )
' ( magit-diff-use-overlays nil )
' ( package-selected-packages
( quote
2021-01-15 00:29:40 +01:00
( dumb-jump csharp-mode yaml-mode smooth-scrolling web-mode multi-web-mode spacemacs-theme flycheck ac-emmet markdown-preview-mode multiple-cursors git-gutter powerline ample-zen-theme monokai-theme dracula-theme auto-complete neotree all-the-icons spinner markdown-mode lv ht f dash-functional ) ) )
2020-08-02 08:33:44 +02:00
' ( pdf-view-midnight-colors ( quote ( " #b2b2b2 " . " #292b2e " ) ) )
2020-08-02 07:57:21 +02:00
' ( pos-tip-background-color " #FFFACE " )
' ( pos-tip-foreground-color " #272822 " )
' ( vc-annotate-background " #3b3b3b " )
' ( vc-annotate-color-map
( quote
( ( 20 . " #dd5542 " )
( 40 . " #CC5542 " )
( 60 . " #fb8512 " )
( 80 . " #baba36 " )
( 100 . " #bdbc61 " )
( 120 . " #7d7c61 " )
( 140 . " #6abd50 " )
( 160 . " #6aaf50 " )
( 180 . " #6aa350 " )
( 200 . " #6a9550 " )
( 220 . " #6a8550 " )
( 240 . " #6a7550 " )
( 260 . " #9b55c3 " )
( 280 . " #6CA0A3 " )
( 300 . " #528fd1 " )
( 320 . " #5180b3 " )
( 340 . " #6380b3 " )
( 360 . " #DC8CC3 " ) ) ) )
' ( vc-annotate-very-old-color " #DC8CC3 " )
' ( weechat-color-list
( quote
( unspecified " #272822 " " #3C3D37 " " #F70057 " " #F92672 " " #86C30D " " #A6E22E " " #BEB244 " " #E6DB74 " " #40CAE4 " " #66D9EF " " #FB35EA " " #FD5FF0 " " #74DBCD " " #A1EFE4 " " #F8F8F2 " " #F8F8F0 " ) ) ) )
( custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
2020-08-10 03:09:34 +02:00
;Configuraciones varias.
( menu-bar-mode 0 ) ;Quitar menús.
( tool-bar-mode 0 ) ;Quitar toolbar.
( global-display-line-numbers-mode ) ;Mostar número de línea.
( setq auto-save-default nil ) ;Deshabilitar #backups# de buffer.
( setq make-backup-files nil ) ;Deshabilitar ~backups.
( setq-default cursor-type 'bar ) ;Define el cursor por defecto.
( global-auto-complete-mode 1 ) ;Activar auto-completar por defecto.
( ac-config-default ) ;Carcar configuración de auto-complete (no recuerdo bien que era esto, puedes revisar la domentación).
2021-01-06 22:13:52 +01:00
( setq ac-ignore-case nil ) ;desactivar el autocapitalizado.
2020-08-10 03:09:34 +02:00
( setq ac-disable-faces nil ) ;auto-complete hablitado incluso entre comillas (fuente: https://bit.ly/3a9wCB4).
( toggle-scroll-bar -1 ) ;Eliminar barra de desplazamiento.
( show-paren-mode 1 ) ;Habilitar resaltado de brackets.
( cua-mode t ) ;Usar CTRL+X, CTRL+C, CTRL+V y CTRL+Z para cortar, copiar, pegar y deshacer.
( setq-default cursor-in-non-selected-windows nil ) ;Desaparecer el cursor en frames no activos.
( global-git-gutter-mode +1 ) ;Git gutter - Marca a la izq. si una linea ha sido agregada, editada o eliminada desde el último commit.
2020-08-17 03:24:34 +02:00
( powerline-default-theme ) ;Habilitar powerline (esa línea bonita de abajo del editor)
( global-hl-line-mode 1 ) ;Resaltar línea actual por defecto.
2020-12-08 19:00:23 +01:00
( add-hook 'xref-backend-functions #' dumb-jump-xref-activate ) ;Habilitar Jump to definition (M-.)
2021-01-15 00:27:11 +01:00
( global-set-key ( kbd " C-<f5> " ) 'recompile ) ;Atajo para compilar
( global-set-key ( kbd " <escape> " ) 'keyboard-escape-quit ) ;Cancelar acción en minibuffer con un solo ESC
2021-01-15 00:36:41 +01:00
( setq ido-everywhere t )
( ido-mode 1 ) ;Habilitar autocompletado "ido" en el minibuffer de manera global (Cuando presionas C+x C+f).
2020-08-06 09:50:33 +02:00
;Desabilitar tabs y usar 2 espacios en su lugar
( setq-default indent-tabs-mode nil ) ;Cambiar tabs por espacios
2020-08-02 07:57:21 +02:00
( setq-default tab-width 2 )
( setq tab-width 2
c-basic-offset 2
c-basic-indent 2
tab-stop-list ' ( 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 )
js-indent-level 2
css-indent-offset 2 )
( c-set-offset 'case-label 2 )
( c-set-offset 'statement-case-intro 2 )
2020-08-06 09:50:33 +02:00
( require 'web-mode )
( setq web-mode-css-indent-offset 2
web-mode-code-indent-offset 2
web-mode-sql-indent-offset 2
web-mode-script-padding 2
web-mode-markup-indent-offset 2 )
( require 'php-mode )
( add-hook 'php-mode-hook #' ( lambda ( )
( php-enable-default-coding-style )
2020-08-10 03:09:34 +02:00
( setq c-basic-offset 2 ) ;Cambio los tabs por 2 espacios (PSR recomienda 4, pero editores como atom y VScode al momento de que configuro esto usan 2 y prefiero mantener esa compatibilidad entre editores).
2020-08-06 09:50:33 +02:00
) )
2020-08-10 03:09:34 +02:00
( setq backward-delete-char-untabify-method 'hungry ) ;Eliminar los falsos tabs con un solo delete.
2020-08-06 09:50:33 +02:00
;Atajos de teclas
2020-08-10 03:09:34 +02:00
( global-set-key ( kbd " C-a " ) 'mark-whole-buffer ) ; Seleccionar todo con CTRL+A.
( global-set-key [ f9 ] 'neotree-toggle ) ;Abrir/Cerrar neotree.
2021-01-06 22:13:52 +01:00
;(global-set-key (kbd "C-<f9>") 'shell) ;Abrir terminal.
2020-08-06 09:50:33 +02:00
;Cursores múltiples
( require 'multiple-cursors )
2020-08-10 03:09:34 +02:00
( global-set-key ( kbd " C-d " ) 'mc/edit-lines ) ;Cursor en todas las lineas seleccionadas.
( global-set-key ( kbd " C-> " ) 'mc/mark-next-like-this ) ;Cursor en siguiente como el actual seleccionado.
( global-set-key ( kbd " C-< " ) 'mc/mark-previous-like-this ) ;Cursor en anteriores como el actual seleccionado.
( global-set-key ( kbd " C-S-d " ) 'mc/mark-all-like-this ) ;Cursor en todos como el actual selecionado.
( global-set-key ( kbd " C-S-<mouse-1> " ) 'mc/add-cursor-on-click ) ;Añadir cursor con clics (Shift+CTRL+Clic).
2020-08-02 07:57:21 +02:00
2020-08-14 02:49:06 +02:00
;Mejorando el scroll
( require 'smooth-scrolling )
( smooth-scrolling-mode 1 ) ;Cambia el salto de líneas cuando el cursor llega al final.
( 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)
2020-08-10 03:09:34 +02:00
;Neotree con iconitos y con tamaño dinámico y sin número de líneas.
2020-08-02 07:57:21 +02:00
( require 'all-the-icons )
( require 'neotree )
( setq neo-theme ( if ( display-graphic-p ) 'icons 'all-the-icons ) )
( setq neo-window-fixed-size nil )
2020-08-17 07:41:22 +02:00
;(setq-default neo-show-hidden-files t) ;Mostar archivos ocultos
2020-08-26 08:44:50 +02:00
( setq neo-hidden-regexp-list ' ( " ^#.*$ " " ^ \\ .#.*$ " ) ) ;Mostrar archivos ocultos excepto los #archivos y .#archivos
2020-08-02 07:57:21 +02:00
( defun my/disable-line-numbers ( &optional dummy )
( display-line-numbers-mode -1 ) )
( add-hook 'neo-after-create-hook 'my/disable-line-numbers )
2020-08-06 09:50:33 +02:00
;Cambiar de major-mode en un archivo que tiene php, html, css y js a la vez según el fracmento de código donde pones el cursor.
2020-08-04 07:05:30 +02:00
( require 'multi-web-mode )
2020-08-04 07:14:24 +02:00
( setq mweb-default-major-mode 'web-mode )
2020-08-04 07:05:30 +02:00
( 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 " ) )
2020-10-06 10:55:59 +02:00
;(multi-web-global-mode 1)
2020-08-04 07:05:30 +02:00
2020-08-10 03:09:34 +02:00
;Habilitar auto-complete-mode en html-mode.
2020-08-04 07:05:30 +02:00
( add-hook 'html-mode-hook #' ( lambda ( )
( auto-complete-mode )
) )
2020-08-02 07:57:21 +02:00
2020-08-10 03:09:34 +02:00
;Habilitar auto-complete-mode en sql-mode.
2020-08-05 01:14:05 +02:00
( add-hook 'sql-mode-hook #' ( lambda ( )
( auto-complete-mode )
) )
2020-12-19 16:50:36 +01:00
;Cambiar comando de compilación por defecto en csharp
( add-hook 'csharp-mode-hook #' ( lambda ( )
( setq compile-command " dotnet run " )
) )
2021-01-25 17:54:26 +01:00
;Borrar espacios, tabs y saltos de línea innecesarios al guardar
( add-hook 'before-save-hook 'kj-delete-trailing-whitespace )
( defun kj-delete-trailing-whitespace ( )
( delete-trailing-whitespace ) )