From 31f2cdc508df908efedb6c7c7b954e57d4d6ef17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Alvari=C3=B1o?= Date: Tue, 22 Mar 2022 12:14:14 +0100 Subject: [PATCH] Add Markdown and Docker configuration - Also add Pending Tasks list --- myconfig.org | 135 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 112 insertions(+), 23 deletions(-) diff --git a/myconfig.org b/myconfig.org index 954f478..4c8d2a3 100644 --- a/myconfig.org +++ b/myconfig.org @@ -1,5 +1,11 @@ #+startup: overview +* Pending task +- Set dap-mode +- Add more programming languages to LSP +- Try =eglot= +- Fix Latex section + * Famous init files - [[https://github.com/zamansky/dot-emacs][The Big Zemansky]] - [[https://github.com/patrickt/emacs][Patrick: GOAT init emacs]] @@ -20,35 +26,36 @@ This file: - Loads the newer of this two files: =myconfig.org= and =myconfig.el=. In other words, if there are no new changes in =myconfig.org= it loads =myconfig.el= (it's faster) * use-package tips - Some notes about [[https://github.com/jwiegley/use-package][use-package]] - - *:ensure* if true will install the package if not installed - It won't update packages. See auto-package-update for keeping all - packages up to date - - *:init* keyword to execute code *before* a package is loaded. It - accepts one or more forms, up to the next keyword - - *:config* can be used to execute code *after* a package is loaded. - In cases where loading is done lazily (see more about autoloading - below), this execution is deferred until after the autoload - occurs - - *:custom* permite configurar variables con syntaxis simplificada - - *:bind* - - *:bind-keymap* - - *:commands* - - *:mode* and *:interpreter* - - *:magic* - - *:hook* You can define hooks - - *:if* - - *:defer* En general use-package intenta aplicar lazy loading, pero - en algún paquete es necesario especificarlo explicitamente - - *:demand* Este es el contrario del anterior, para paquetes - que queremos cargar de inmediato - - *:diminish* and *:delight* changes minormode display in status line +Some notes about [[https://github.com/jwiegley/use-package][use-package]] +- *:ensure* if true will install the package if not installed + It won't update packages. See auto-package-update for keeping all + packages up to date +- *:init* keyword to execute code *before* a package is loaded. It + accepts one or more forms, up to the next keyword +- *:config* can be used to execute code *after* a package is loaded. + In cases where loading is done lazily (see more about autoloading + below), this execution is deferred until after the autoload + occurs +- *:custom* permite configurar variables con syntaxis simplificada +- *:bind* +- *:bind-keymap* +- *:commands* +- *:mode* and *:interpreter* +- *:magic* +- *:hook* You can define hooks +- *:if* +- *:defer* En general use-package intenta aplicar lazy loading, pero + en algún paquete es necesario especificarlo explicitamente +- *:demand* Este es el contrario del anterior, para paquetes + que queremos cargar de inmediato +- *:diminish* and *:delight* changes minormode display in status line * Personal info #+begin_src elisp (setq user-full-name "Sergio Alvariño" user-mail-address "salvari@protonmail.com") #+end_src + * Interface tweaks ** Some GUI optimizations #+begin_src emacs-lisp @@ -609,6 +616,53 @@ Nice bullets for org-mode ) #+end_src +** Fonts for org-mode +Definimos una función que se encargará de: +- Establecer la fuente para org-mode (Cantarell) +- Establecer tamaños escalados para las cabeceras +- Establecer fuentes de ancho fijo para secciones de código en los ficheros =.org= + +#+begin_src emacs-lisp + (defun slv/org-font-setup () + (dolist (face '((org-level-1 . 1.2) + (org-level-2 . 1.1) + (org-level-3 . 1.05) + (org-level-4 . 1.0) + (org-level-5 . 1.1) + (org-level-6 . 1.1) + (org-level-7 . 1.1) + (org-level-8 . 1.1))) + (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-table nil :inherit 'fixed-pitch) + (set-face-attribute 'org-formula 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) + (set-face-attribute 'line-number nil :inherit 'fixed-pitch) + (set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch) + ) +#+end_src + +** Some additional tweaks for org-mode +Añadimos algunos detalles a la visualización de org-mode +- Aumentamos el tamaño de la visualización de código LaTeX renderizado (usa =C-c C-x C-l= para conmutar la visualización) +#+begin_src emacs-lisp + (defun slv/org-tweaks-setup () + (plist-put org-format-latex-options :scale 2) ;; Increase size of LaTeX fragment previews + (setq org-startup-indented t + org-pretty-entities t + org-hide-emphasis-markers t + org-startup-with-inline-images t + org-image-actual-width '(300)) + ) +#+end_src + * flycheck You *must* use [[https://www.flycheck.org/en/latest/][flycheck]] if you use LSP. (Flymake + LSP is hell) Syntax checking for programming languages @@ -891,6 +945,41 @@ Usamos =pyenv= para gestionar los /virtualenv/ ("C-x p e" . pyenv-activate-current-project)) #+end_src +* Markdown +- [[https://leanpub.com/markdown-mode/read#intro][Guide to Emacs Markdown mode]] +- [[https://joostkremers.github.io/pandoc-mode/][Pandoc Mode Doc]] +#+begin_src emacs-lisp + (use-package markdown-mode + :init (setq markdown-command "multimarkdown") + :mode (("README\\.md\\'" . gfm-mode) + ("\\.md\\'" . markdown-mode) + ("\\.markdown\\'" . markdown-mode) + ("\\.pdc\\'" . markdown-mode) + ) + ) + (use-package pandoc-mode + ) +#+end_src + +* Docker +#+begin_src emacs-lisp + (use-package dockerfile-mode + :config + (add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode)) + ) + (use-package docker-compose-mode + ) +#+end_src + +* LaTeX +#+begin_src emacs-lisp + ;; (use-package tex + ;; :defer t + ;; :ensure auctex + ;; :config + ;; (setq TeX-auto-save t)) +#+end_src + * next #+begin_src emacs-lisp