Compare commits

..

3 Commits

Author SHA1 Message Date
kj
52f8c664e6 Improve emacs startup. 2022-05-03 23:25:07 -04:00
kj
b4e1c001ab Add shortcuts to origami (code folding). 2022-05-03 23:24:33 -04:00
kj
1678f7b283 Add some prettify changes to org-mode. 2022-05-03 23:23:46 -04:00
4 changed files with 88 additions and 52 deletions

View File

@ -9,12 +9,14 @@
;; use-package - No necesita presentación
(use-package use-package
:defer t
:config
(setq use-package-always-ensure t) ; auto-instalar extenciones que no lo estén
)
;; Auto-actualizar los paquetes
(use-package auto-package-update
:defer t
:custom
(auto-package-update-interval 7)
(auto-package-update-prompt-before-update t)
@ -45,12 +47,13 @@
;; Mover líneas o regiones
(use-package drag-stuff
:defer t
:config
(drag-stuff-global-mode 1)
(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")))
@ -59,29 +62,23 @@
;; Guardar la posición del cursor en un archivo para volver allí cuando se lo vuelva a abrir.
(use-package saveplace
:defer t
:config
(save-place-mode 1)
(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
:config
(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes
(add-hook 'html-mode-hook 'emmet-mode)
(add-hook 'css-mode-hook '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
:config
(global-git-gutter-mode +1) ; Habilitar git gutter de manera global
)
(use-package git-gutter :defer t)
;; Mejorando el scroll
(use-package smooth-scrolling
:defer t
:config
(smooth-scrolling-mode 1) ; Cambia el salto de líneas cuando el cursor llega al final.
(setq mouse-wheel-scroll-amount
@ -90,6 +87,7 @@
)
(use-package doom-modeline
:defer t
:ensure t
:init (doom-modeline-mode 1)
:config
@ -102,10 +100,7 @@
)
;; Code Folding
(use-package origami
:defer t
:config
(global-origami-mode))
(use-package origami :defer t)
;; Reemplazar y buscar menjorado
(use-package anzu
@ -129,7 +124,7 @@
(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-gtags company-etags company-keywords :with company-yasnippet)
(company-dabbrev-code company-ctags company-keywords :with company-yasnippet)
(company-dabbrev :with company-yasnippet)))
)
@ -147,10 +142,7 @@
:hook (company-mode . company-box-mode))
;; Usar autocompletado con ctags y company
(use-package company-ctags
:config
(add-to-list 'company-backends '(company-ctags))
)
(use-package company-ctags :defer t)
;; Snippets
(use-package yasnippet
@ -165,6 +157,7 @@
;; Restaurar el estado de los frames
(use-package winner
:defer t
:init
(winner-mode 1))
@ -174,7 +167,7 @@
:custom
(lsp-headerline-breadcrumb-enable nil))
(use-package lsp-ui)
(use-package lsp-ui :defer t)
;; Revisar sintaxis en vivo
(use-package flycheck
@ -190,6 +183,7 @@
;; Un bonito y sencillo panel de inicio
(use-package dashboard
:defer t
:config
(setq dashboard-set-file-icons t)
(setq dashboard-startup-banner
@ -198,7 +192,6 @@
;;(recents . 5)
;;(projects . 5)
))
(dashboard-setup-startup-hook)
)
;; Autocompletado para shell scripting.
@ -210,13 +203,15 @@
;; Autocompletado para el minibuffer (counsel e ivy)
(use-package counsel
:defer t
:bind
("M-x" . counsel-M-x)
("C-x C-m" . counsel-M-x)
("C-x C-f" . counsel-find-file)
("C-x c k" . counsel-yank-pop))
("C-x y" . counsel-yank-pop))
(use-package projectile
:defer t
:diminish projectile-mode
:config
(projectile-mode)
@ -231,18 +226,10 @@
;; 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 "~/Docker/Nginx")
(when (file-directory-p "~/mnt/Nginx")
(setq projectile-project-search-path (append
projectile-project-search-path
'("~/Docker/Nginx"))))
(when (file-directory-p "~/Docker/Nginx2")
(setq projectile-project-search-path (append
projectile-project-search-path
'("~/Docker/Nginx2"))))
(when (file-directory-p "~/Docker/NginxTwitch")
(setq projectile-project-search-path (append
projectile-project-search-path
'("~/Docker/NginxTwitch"))))
'("~/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
@ -259,8 +246,8 @@
;; Autocompletado de proyectos en counsel (projectile)
(use-package counsel-projectile
:defer t
:config
(global-set-key (kbd "C-x p") 'counsel-projectile)
(counsel-projectile-mode))
;; Mostrar info del panel inferior de otra manera
@ -280,24 +267,34 @@
;; Iconos en Ivy (allthe icons)
(use-package all-the-icons-ivy-rich
:defer t
:ensure t
:init (all-the-icons-ivy-rich-mode 1)
:config
(setq all-the-icons-ivy-rich-color-icon t))
(use-package ivy-rich
:ensure t
:init (ivy-rich-mode 1))
:defer t)
;; Cuando iniicias un atajo de teclas te muestra las posibilidades
(use-package which-key
:config
(which-key-mode))
(use-package which-key :defer t)
;; Autocompletado de parentesis, corchetes, llaves, etc.
(use-package smartparens
:config
(smartparens-global-mode t))
(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
(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)
;; Org-Mode
(require 'org-config)

View File

@ -47,5 +47,12 @@
(global-set-key (kbd "C-x /") 'query-replace-regexp)
(global-set-key (kbd "M-/") 'query-replace)
;; Atajo para origami-mode
(global-set-key (kbd "C-<tab>") 'origami-toggle-node)
(global-set-key (kbd "C-S-<tab>") 'origami-toggle-all-nodes)
;; Atajo para counsel-proyectile
(global-set-key (kbd "C-x p") 'counsel-projectile)
(provide 'base-keys)
;;; base-keys.el ends here

View File

@ -12,7 +12,7 @@
(use-package php-mode
:defer t
:bind ("<C-tab>" . php-doc-block)
:bind ("C-c d b" . php-doc-block)
:config
(add-hook 'php-mode-hook #'(lambda()
(php-enable-default-coding-style)

View File

@ -8,13 +8,30 @@
;;; Code:
(defun kj/org-hook ()
"Configuración para el hook de 'org-mode'."
(display-line-numbers-mode 0)
(variable-pitch-mode 1)
(visual-line-mode 1)
(visual-fill-column-mode 1)
;; Configuración de font
;; Configuración de fonts
(set-face-attribute (car face) nil :font "Cantarell" :weight 'regular :height (cdr face))
;; Ensure that anything that should be fixed-pitch in Org files appears that way
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch)
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
;; Tachar los elementos "DONE"
(set-face-attribute 'org-done nil :strike-through t)
(set-face-attribute 'org-headline-done nil
:strike-through t
:foreground "light gray")
)
(use-package org
@ -32,6 +49,7 @@
(setq org-log-into-drawer t)
(setq org-cycle-separator-lines -1)
;; Identación
(org-indent-mode)
;; Palabras claves del To Do de org-mode
@ -46,6 +64,26 @@
("CANCELED" . "#aaa"))
)
;; Embellecer los checkbox
(add-hook 'org-mode-hook (lambda ()
"Beautify Org Checkbox Symbol"
(push '("[ ]" . "") prettify-symbols-alist)
(push '("[X]" . "" ) prettify-symbols-alist)
(push '("[-]" . "" ) prettify-symbols-alist)
(prettify-symbols-mode)))
;; Tachar los checkbox marcados como terminados
(defface org-checkbox-done-text
'((t (:foreground "#71696A" :strike-through t)))
"Face for the text part of a checked org-mode checkbox.")
(font-lock-add-keywords
'org-mode
`(("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)"
1 'org-checkbox-done-text prepend))
'append)
;; Archivos a usarse en org-agenda
(setq org-agenda-files
'("~/Proyectos/ORGenda/Ideas.org"
@ -82,15 +120,9 @@
)
)
(use-package org-superstar
(use-package org-bullets
:hook
(org-mode . org-superstar-mode)
:config
(setq org-superstar-special-todo-items t)
;; Eliminar los puntitos anteriores a un heading.
(setq org-hide-leading-stars nil)
(setq org-superstar-leading-bullet ?\s)
)
(org-mode . org-bullets-mode))
(use-package visual-fill-column
:config