confi-emacs-inicial/init.el

169 lines
7.0 KiB
EmacsLisp

;Repositorio MELPA
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
;Directorio personalizado para mis themes
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(package-initialize)
;Aquí vienen cosas de los themes y los paquetes
(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
("fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088" "bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" "c7eb06356fd16a1f552cfc40d900fe7326ae17ae7578f0ef5ba1edd4fdd09e58" "f3ab34b145c3b2a0f3a570ddff8fabb92dafc7679ac19444c31058ac305275e1" "dcdd1471fde79899ae47152d090e3551b889edf4b46f00df36d653adc2bf550d" "3994b1c5c1f412c025bb71b2df5973a421c257afee5278684639c205d79d93ee" default)))
'(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))))
'(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"))))
'(inhibit-startup-screen t)
'(magit-diff-use-overlays nil)
'(package-selected-packages
(quote
(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 evil dash-functional)))
'(pdf-view-midnight-colors (quote ("#b2b2b2" . "#292b2e")))
'(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.
)
(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
(global-auto-complete-mode 1) ;Activar auto-completar por defecto
(ac-config-default)
(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-set-key (kbd "TAB") 'tab-to-tab-stop) ;n tab = 2 espacio
;(global-set-key "\t" (lambda () (interactive) (insert-char 32 2))) ; Un tab = 2 espacios
(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)
(setq-default indent-tabs-mode nil) ;Desabilitar tabs y usar espacios
(setq backward-delete-char-untabify-method 'hungry) ;Eliminar los falsos tabs con un solo delete
(global-set-key (kbd "C-a") 'mark-whole-buffer); Seleccionar todo con CTRL+a
(global-set-key (kbd "C-<f9>") 'shell) ;Abrir terminal
(toggle-scroll-bar -1) ;Eliminar barra de desplazamiento
(show-paren-mode 1) ;Habilitar resaltado de brackets
;Neotree con iconitos y con tamaño dinámico y sin número de líneas
(require 'all-the-icons)
(require 'neotree)
(global-set-key [f9] 'neotree-toggle)
(setq neo-theme (if (display-graphic-p) 'icons 'all-the-icons))
(setq neo-window-fixed-size nil)
(setq-default neo-show-hidden-files t)
(defun my/disable-line-numbers (&optional dummy)
(display-line-numbers-mode -1))
(add-hook 'neo-after-create-hook 'my/disable-line-numbers)
;Git gutter - Marca si
(global-git-gutter-mode +1)
;Cursoles múltiples
(require 'multiple-cursors)
(global-set-key (kbd "C-d") 'mc/edit-lines) ;Editar todas las lineas seleccionadas
(global-set-key (kbd "C->") 'mc/mark-next-like-this) ;Selecionar siguiente como el actual
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) ;Seleccionar anteriores como el actual
(global-set-key (kbd "C-S-d") 'mc/mark-all-like-this) ;Seleccionar todos como el actual
(global-set-key (kbd "C-S-<mouse-1>") 'mc/add-cursor-on-click) ;Añadir cursor con clics (Shift+CTRL+Clic)
(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)
; Cambiar de modos en un archivo que tiene php, html, css y js a la vez.
(require 'multi-web-mode)
(setq mweb-default-major-mode 'web-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"))
(multi-web-global-mode 1)
;Habilitar siempre auto-complete-mode en html-mode
(add-hook 'html-mode-hook #'(lambda()
(auto-complete-mode)
))
(powerline-default-theme); Habilitar powerline (esa línea bonita de abajo del editor)
(require 'php-mode)
(add-hook 'php-mode-hook #'(lambda()
(php-enable-default-coding-style)
(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)
; (web-mode) ;Pongo PHP siempre en webmode en caso de tener php-mode
))