From 0e7883ced07fd87238eb571d0fec20e348702bca Mon Sep 17 00:00:00 2001 From: drymer Date: Thu, 30 Mar 2017 07:53:39 +0000 Subject: [PATCH] Mejoras en el instalador y otros --- .gitignore | 1 + emacs.d/init-literate.org | 337 ++++++++++++++++++++++++++++---------- emacs.d/init.el | 18 ++ instala.sh | 330 +++++++++++++++++++++++++------------ qutebrowser/keys.conf | 6 +- shell/aliases | 4 +- shell/zshrc | 3 + 7 files changed, 505 insertions(+), 194 deletions(-) diff --git a/.gitignore b/.gitignore index 7fe97a7..3f581d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /i3/scripts/weather /emacs.d/private-literate.org +/programas/* \ No newline at end of file diff --git a/emacs.d/init-literate.org b/emacs.d/init-literate.org index c474877..b3b3c39 100644 --- a/emacs.d/init-literate.org +++ b/emacs.d/init-literate.org @@ -24,6 +24,7 @@ - [[Buscar más eficazmente en Helm][Buscar más eficazmente en Helm]] - [[ivy-mode][ivy-mode]] - [[counsel-dash][counsel-dash]] + - [[ace-isearch][ace-isearch]] - [[Seguir enlaces simbólicos][Seguir enlaces simbólicos]] - [[Emparejar parentesis y otros][Emparejar parentesis y otros]] - [[Mantener lista de buffers recientes][Mantener lista de buffers recientes]] @@ -45,6 +46,8 @@ - [[Buffer \ast{}Scratch\ast{} persistente][Buffer \ast{}Scratch\ast{} persistente]] - [[kill-this-buffer en vez de kil-buffer][kill-this-buffer en vez de kil-buffer]] - [[emacs-purpose o proposito][emacs-purpose o proposito]] + - [[Yasnippet][Yasnippet]] + - [[Ispell][Ispell]] - [[Paquetes genéricos][Paquetes genéricos]] - [[Imenu][Imenu]] - [[imenu-list][imenu-list]] @@ -57,6 +60,8 @@ - [[Flycheck][Flycheck]] - [[Rainbow-mode][Rainbow-mode]] - [[i3wm-config-mode][i3wm-config-mode]] + - [[Lorem Ipsum][Lorem Ipsum]] + - [[Pastear en sprunge.us][Pastear en sprunge.us]] - [[Aspecto][Aspecto]] - [[Tema cyberpunk][Tema cyberpunk]] - [[Powerline modificada][Powerline modificada]] @@ -66,7 +71,7 @@ - [[Tipo de fuente][Tipo de fuente]] - [[Partir buffers de manera más bonita][Partir buffers de manera más bonita]] - [[Scroll][Scroll]] - - [[Configuración por modos][Configuración por modos]] + - [[Configuración por modos o lenguajes][Configuración por modos o lenguajes]] - [[JSON][JSON]] - [[Haskel][Haskel]] - [[Markdown][Markdown]] @@ -111,10 +116,13 @@ - [[Empareja simbolos de marcado y paréntesis][Empareja simbolos de marcado y paréntesis]] - [[org-protocol][org-protocol]] - [[Temas para exportación en html][Temas para exportación en html]] + - [[Ejecución de bloques babel asyncrona][Ejecución de bloques babel asyncrona]] + - [[org-brain][org-brain]] - [[mail-mode][mail-mode]] - [[lisp][lisp]] - [[Paredit][Paredit]] - [[package-lint][package-lint]] + - [[rainbow-delimiters][rainbow-delimiters]] - [[Funciones personalizadas][Funciones personalizadas]] - [[Recargar todos los buffers abiertos][Recargar todos los buffers abiertos]] - [[Insertar cabeceras para org-mode][Insertar cabeceras para org-mode]] @@ -134,7 +142,7 @@ Este documento está hecho en org-mode y es tanto mi configuración de emacs com Mi idea es que termine siendo más o menos un tutorial de emacs, tal vez extendido con los articulos del blog. A ver como sale. Se puede instalar mi configuración de emacs del siguiente modo: #+BEGIN_SRC bash :tangle no :eval no -git clone https://daemons.cf/cgit/dotfiles +git clone https://daemons.it/cgit/dotfiles cd dotfiles ./instala.sh emacs #+END_SRC @@ -159,13 +167,13 @@ emacs -Q --batch --eval "(load-file \""$EMACSDIR/"init-literate.el\")" emacs -Q --batch --eval "(load-file \"/tmp/powerline.el\"))" # Por algún motivo al compilar desde el-get mete una ruta incorrecta en org-loaddefs.el -find $EMACSDIR -name 'org-loaddefs.el' | xargs sed -i "s,org-mode-maint/lisp/,,g" +sed -i "s,org-mode-maint/lisp/,,g" $EMACSDIR/el-get/org-mode-maint/lisp/org-loaddefs.el # Necesito permiso de superusuario para copiar los scripts capture y demacs en /usr/local/bin/ sudo ln -sf $(pwd)/emacs.d/{capture,demacs} /usr/local/bin/ #+END_SRC -Este archivo en formato org-mode está [[https://daemons.cf/cgit/dotfiles/plain/emacs.d/init-literate.org][aquí]]. Este archivo en formato HTML está [[https://daemons.cf/stories/mi-configuracin-de-emacs/][aquí]]. +Este archivo en formato org-mode está [[https://daemons.it/cgit/dotfiles/plain/emacs.d/init-literate.org][aquí]]. Este archivo en formato HTML está [[https://daemons.it/stories/mi-configuracin-de-emacs/][aquí]]. * Configuración Genérica :PROPERTIES: :CUSTOM_ID: Configuración Genérica @@ -340,7 +348,7 @@ No funciona en =org-mode=. :PROPERTIES: :CUSTOM_ID: Helm :END: -Copiado del git de helm. Esta es una configuración bastante mínima. Más información por [[http://daemons.cf/categories/helm/][aquí]]. Está activo, pero solo para counsel-dash. +Copiado del git de helm. Esta es una configuración bastante mínima. Más información por [[http://daemons.it/categories/helm/][aquí]]. Está activo, pero solo para counsel-dash. #+name:helm #+BEGIN_SRC emacs-lisp :tangle no @@ -368,7 +376,7 @@ Copiado del git de helm. Esta es una configuración bastante mínima. Más infor :PROPERTIES: :CUSTOM_ID: Buscar más eficazmente en Helm :END: -Más información en [[http://daemons.cf/posts/cosillas-de-emacs-buscar-en-el-buffer/][este articulo]]. Desactivado actualmente. +Más información en [[http://daemons.it/posts/cosillas-de-emacs-buscar-en-el-buffer/][este articulo]]. Desactivado actualmente. #+name:buscar-helm #+BEGIN_SRC emacs-lisp :tangle no @@ -383,7 +391,7 @@ Más información en [[http://daemons.cf/posts/cosillas-de-emacs-buscar-en-el-bu :PROPERTIES: :CUSTOM_ID: ivy-mode :END: -Ivy es más liviano que helm, aunque más simple. Más información [[https://daemons.cf/posts/migrar-de-helm-a-ivy/][aquí]]. +Ivy es más liviano que helm, aunque más simple. Más información [[https://daemons.it/posts/migrar-de-helm-a-ivy/][aquí]]. #+name:ivy-mode #+BEGIN_SRC emacs-lisp @@ -441,17 +449,17 @@ Ivy es más liviano que helm, aunque más simple. Más información [[https://da ("M-y" . counsel-yank-pop) :map ivy-minibuffer-map ("M-y" . ivy-next-line-and-call) - ("C-c C-r" . ivy-resume) - ) + ("C-c C-r" . ivy-resume)) :config ;; usar ffap (setq counsel-find-file-at-point t) :ensure t) (use-package swiper - :bind (;; Sustituir isearch - ("C-s" . swiper) - ("C-r" . swiper)) + ;; comentado en favor de ace-isearch + ;; :bind (;; Sustituir isearch + ;; ("C-s" . swiper) + ;; ("C-r" . swiper)) :ensure t) #+END_SRC *** counsel-dash @@ -500,7 +508,30 @@ Auto-instala los docsets: #+END_SRC -p +*** ace-isearch +:PROPERTIES: +:CUSTOM_ID: ace-isearch +:END: +#+BEGIN_SRC emacs-lisp +(use-package ace-isearch + :load-path "~/Proyectos/ace-isearch/" + :ensure t + :init + ;; Dependencias + ;; (use-package helm-swoop :ensure t) + (use-package avy :ensure t) + ;; (use-package ace-jump-mode :ensure t) + :config + (setq ace-isearch-function 'ace-jump-char-mode) + (setq ace-isearch-input-length 5) + (setq ace-isearch-jump-delay 0.30) + (setq ace-isearch-use-jump 'printing-char) + (setq ace-isearch-function-from-isearch 'ace-isearch-swiper-from-isearch) + (global-ace-isearch-mode +1) + :bind (:map isearch-mode-map + ("C-'" . ace-isearch-jump-during-isearch))) +#+END_SRC + ** Seguir enlaces simbólicos :PROPERTIES: :CUSTOM_ID: Seguir enlaces simbólicos @@ -563,7 +594,8 @@ Al usar ivy o helm y ejecutar =switch-buffer= (C-x b) se pueden ver los buffers ("C-x g" . magit-status) :config ;; usar un wrapper que torifica git - (setq magit-git-executable "/usr/local/bin/tgit")) + (setq magit-git-executable "/usr/local/bin/tgit") + :ensure t) #+END_SRC El wrapper es el siguiente: @@ -833,14 +865,49 @@ Fuente: http://pragmaticemacs.com/emacs/dont-kill-buffer-kill-this-buffer-instea (setq purpose-user-name-purposes '(("index.org" . agenda) ("index.org_archive" . agenda) - ("marcadores.org" . agenda) + ("web.org" . agenda) ("notas.org" . agenda) (" *command-log*" . command))) (purpose-compile-user-configuration) :config + ;; https://github.com/bmag/ivy-purpose/issues/1 + (define-purpose-prefix-overload purpose-switch-buffer-overload + '(ivy-switch-buffer + switch-buffer-without-purpose + purpose-switch-buffer-with-purpose)) (purpose-mode)) #+END_SRC +** Yasnippet +:PROPERTIES: +:CUSTOM_ID: Yasnippet +:END: +#+BEGIN_SRC emacs-lisp +(if (not (el-get-package-installed-p 'yasnippet)) + (el-get 'sync 'yasnippet)) + +(use-package yasnippet + :load-path "el-get/yasnippet/" + :config + (yas-global-mode) + (setq yas-snippet-dirs + '("~/.emacs.d/snippets" + "~/.emacs.d/el-get/yasnippet/snippets/" + "~/.emacs.d/el-get/yasnippet/yasmate/")) + (add-to-list 'hippie-expand-try-functions-list 'yas-hippie-try-expand) + (setq yas-prompt-functions '(yas-ido-prompt)) + :diminish + yas-minor-mode) +#+END_SRC +** Ispell +:PROPERTIES: +:CUSTOM_ID: Ispell +:END: +Instalamos el diccionario de [[https://www.cs.hmc.edu/~geoff/ispell-dictionaries.html#Spanish-dicts][esta dirección]] y configuramos emacs para que lo use: + +#+BEGIN_SRC bash +(setq ispell-dictionary "español") +#+END_SRC ** Paquetes genéricos :PROPERTIES: :CUSTOM_ID: Paquetes genéricos @@ -874,7 +941,7 @@ Muestra imenu en un buffer lateral. No está activo. :PROPERTIES: :CUSTOM_ID: csv-mode :END: -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle no (use-package csv-mode :ensure t) #+END_SRC *** Paleta de colores @@ -907,8 +974,9 @@ Muestra imenu en un buffer lateral. No está activo. :PROPERTIES: :CUSTOM_ID: Hardcodear atajos de teclado :END: +Desactivado. #+name:hardcore-mode -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle no (use-package hardcore-mode :ensure t :config @@ -959,6 +1027,9 @@ Muestra imenu en un buffer lateral. No está activo. (global-hardcore-mode)) #+END_SRC *** Flycheck +:PROPERTIES: +:CUSTOM_ID: Flycheck +:END: Corrector #+BEGIN_SRC emacs-lisp (use-package flycheck @@ -966,12 +1037,18 @@ Corrector :config (global-flycheck-mode)) #+END_SRC *** Rainbow-mode +:PROPERTIES: +:CUSTOM_ID: Rainbow-mode +:END: Muestra los colores de paletas HTML (hexadecimal) con el color que representa. -#+BEGIN_SRC emacs-lisp +#+BEGIN_SRC emacs-lisp :tangle no (use-package rainbow-mode :ensure t) #+END_SRC *** i3wm-config-mode +:PROPERTIES: +:CUSTOM_ID: i3wm-config-mode +:END: Muestra colores para la configuración de i3. #+BEGIN_SRC emacs-lisp (add-to-list 'el-get-sources '(:name i3wm-config-mode @@ -982,7 +1059,39 @@ Muestra colores para la configuración de i3. (el-get 'sync 'i3wm-config-mode)) (use-package i3wm-config-mode - :load-path "el-get/i3wm-Config-Mode") + :load-path "el-get/i3wm-config-mode") +#+END_SRC +*** Lorem Ipsum +:PROPERTIES: +:CUSTOM_ID: Lorem Ipsum +:END: +Inserta Lorem Ipsum. + +#+BEGIN_SRC emacs-lisp +(if (not (el-get-package-installed-p 'lorem-ipsum)) + (el-get 'sync 'lorem-ipsum)) + +(use-package lorem-ipsum + :load-path "el-get/lorem-ipsum") +#+END_SRC + +*** Pastear en sprunge.us +:PROPERTIES: +:CUSTOM_ID: Pastear en sprunge.us +:END: +#+name: sprunge +#+BEGIN_SRC emacs-lisp +(add-to-list 'el-get-sources '(:name sprunge + :type github + :pkgname "tomjakubowski/sprunge.el")) + +(if (not (el-get-package-installed-p 'sprunge)) + (el-get 'sync 'sprunge)) + +(use-package sprunge + :init + (use-package request :ensure t) + :load-path "el-get/sprunge") #+END_SRC * Aspecto :PROPERTIES: @@ -1379,7 +1488,7 @@ Similar a la manera de vim. No tengo claro en que se diferencia, pero me gusta c scroll-down-aggressively 0.02) #+END_SRC -* Configuración por modos +* Configuración por modos o lenguajes :PROPERTIES: :CUSTOM_ID: Configuración por modos :END: @@ -1430,16 +1539,17 @@ Cargar =markdown-mode=, usar utf-8 al exportar y asociar el modo a las extension La configuración de elpy: #+name: elpy #+BEGIN_SRC emacs-lisp - (use-package elpy - :init - (setq elpy-modules '(elpy-module-sane-defaults elpy-module-company elpy-module-eldoc elpy-module-pyvenv)) - (add-hook 'python-mode-hook 'flycheck-mode) - (setq elpy-rpc-backend "jedi") - :config - (add-to-list 'ivy-completing-read-handlers-alist '(elpy-doc . completing-read-default)) ;; véase https://github.com/abo-abo/swiper/issues/892 - (elpy-enable) - :ensure t - ) +(if (not (el-get-package-installed-p 'elpy)) + (el-get 'sync 'elpy)) + +(use-package elpy + :init + (setq elpy-modules '(elpy-module-sane-defaults elpy-module-company elpy-module-eldoc elpy-module-pyvenv)) + (add-hook 'python-mode-hook 'flycheck-mode) + (setq elpy-rpc-backend "jedi") + :config + (add-to-list 'ivy-completing-read-handlers-alist '(elpy-doc . completing-read-default)) ;; véase https://github.com/abo-abo/swiper/issues/892 + (elpy-enable)) #+END_SRC Este paquete muestra una ralla que marca los 79 carácteres, para cumplir con el pep8. @@ -1708,6 +1818,7 @@ Se usa la rama =maint= del repositorio git. Primero se comprueba si está instal ("bf" "Articles publicats" ((todo "DONE" ((org-agenda-files '("~/Documentos/blog/Articulos/articulos.org")))))) ("p" . "Projectes Personals") ("pp" "Projectes Personals" tags-todo "projectes") + ("pa" "antisocial" tags-todo "antisocial") ("pg" "General" tags-todo "general") ("pi" "isso-gnusocial" tags-todo "issoGnusocial") ("pr" "gnusrss" tags-todo "gnusrss") @@ -1717,6 +1828,8 @@ Se usa la rama =maint= del repositorio git. Primero se comprueba si está instal ("v" "Relacionat amb els VPS / chustaserver" tags-todo "vps") ("w" "Webs" tags "" ((org-agenda-files '("~/Documentos/org/web.org")))))) #+END_SRC + + **** Capturas de notas :PROPERTIES: :CUSTOM_ID: Capturas de notas @@ -1745,6 +1858,8 @@ Se usa la rama =maint= del repositorio git. Primero se comprueba si está instal '(("o" "Ordinadors") ("og" "General" entry (file+headline "~/Documentos/org/index.org" "General") "* TODO %?\n:PROPERTIES:\n:CREATED: %u\n:END:\n") + ("oa" "Antisocial" entry (file+headline "~/Documentos/org/index.org" "antisocial") + "* TODO %?\n:PROPERTIES:\n:CREATED: %u\n:END:\n") ("oi" "isso-gnusocial" entry (file+headline "~/Documentos/org/index.org" "isso-gnusocial") "* TODO %?\n:PROPERTIES:\n:CREATED: %u\n:END:\n") ("or" "gnusrss" entry (file+headline "~/Documentos/org/index.org" "gnusrss") @@ -1894,21 +2009,27 @@ Por defecto, al pasar de las 24 horas dedicadas, lo mostrará cómo 1d. Con el s :CUSTOM_ID: Definir lenguajes que entiende babel :END: #+BEGIN_SRC emacs-lisp - (org-babel-do-load-languages - 'org-babel-load-languages - '((dot . t) - (emacs-lisp . t) - (gnuplot . t) - (latex . t) - (ledger . t) - (python . t) - (shell . t) - (sql . t) - (sqlite . t))) +(org-babel-do-load-languages + 'org-babel-load-languages + '((dot . t) + (emacs-lisp . t) + (gnuplot . t) + (latex . t) + (ledger . t) + (python . t) + (shell . t) + (sql . t) + (sqlite . t))) #+END_SRC #+RESULTS: +#+BEGIN_SRC emacs-lisp +(use-package yaml-mode :ensure t) +(add-to-list 'org-src-lang-modes '("yaml" . yaml)) +(add-to-list 'org-src-lang-modes '("dockerfile" . dockerfile)) +#+END_SRC + **** Asteriscos bonitos :PROPERTIES: :CUSTOM_ID: Asteriscos bonitos @@ -1982,7 +2103,7 @@ La primera línea esconde los símbolos y aplica el marcado, y la segunda cambia :END: Cada vez que se evalua código de un bloque, pide que se confirme. Con el siguiente código, no lo hará. #+BEGIN_SRC emacs-lisp - (setq org-confirm-babel-evaluate nil) +(setq org-confirm-babel-evaluate nil) #+END_SRC **** Añadir imágenes in-line :PROPERTIES: @@ -2022,52 +2143,48 @@ No está cargado ni configurado, lo mantengo por si acaso. Para publicar articul :PROPERTIES: :CUSTOM_ID: org2nikola :END: -Sirve para publicar en =nikola= con marcado =org-mode=. Si no está instalado, lo instala mediante el-get. [[https://daemons.cf/posts/nikola-emacs-gestionar-un-blog-de-contenido-esttico/][Más información (o no)]]. +Sirve para publicar en =nikola= con marcado =org-mode=. Si no está instalado, lo instala mediante el-get. [[https://daemons.it/posts/nikola-emacs-gestionar-un-blog-de-contenido-esttico/][Más información (o no)]]. -#+BEGIN_SRC emacs-lisp - (add-to-list 'el-get-sources '(:name org2nikola - :website "https://github.com/redguardtoo/org2nikola.git" - :description "Export org into HTML used by static blog generator nikola." - :type git - :url "https://github.com/redguardtoo/org2nikola.git" - )) +#+BEGIN_SRC emacs-lisp :tangle no +(add-to-list 'el-get-sources '(:name org2nikola + :website "https://github.com/redguardtoo/org2nikola.git" + :description "Export org into HTML used by static blog generator nikola." + :type git + :url "https://github.com/redguardtoo/org2nikola.git")) - (if (not (el-get-package-installed-p 'org2nikola)) - (el-get 'sync 'org2nikola) - ) +(if (not (el-get-package-installed-p 'org2nikola)) + (el-get 'sync 'org2nikola)) #+END_SRC Las funciones cutres son mías. #+name:org2nikola #+BEGIN_SRC emacs-lisp - (use-package org2nikola - :load-path "el-get/org2nikola" - :init - ;; Se instala el htmlize de melpa, el de org-mode es demasiado viejo - (use-package htmlize :ensure t) - :config - (setq org2nikola-output-root-directory "~/Documentos/blog/") - (setq org2nikola-use-verbose-metadata t) +(use-package org2nikola + :load-path "~/Proyectos/org2nikola/" + :init + ;; Se instala el htmlize de melpa, el de org-mode es demasiado viejo + (use-package htmlize :ensure t) + :config + (setq org2nikola-output-root-directory "/home/drymer/Documentos/blog/") + (setq org2nikola-use-verbose-metadata t) - ;; Las dos siguientes funciones probablemente no sirvan a nadie - (defun nikola/url-post () - "Devuelve el enlace del articulo en el que esté el cursor." - (interactive) - (setq url (concat "https://daemons.cf/posts/" - (cdr (car (org-entry-properties (point) "post_slug"))))) - (message url) - (kill-new url) - ) + ;; Las dos siguientes funciones probablemente no sirvan a nadie + (defun nikola/url-post () + "Devuelve el enlace del articulo en el que esté el cursor." + (interactive) + (setq url (concat "https://daemons.it/posts/" + (cdr (car (org-entry-properties (point) "post_slug"))))) + (message url) + (kill-new url)) - (defun nikola/url-config () - "Devuelve el enlace de la parte de la configuración en la que esté el cursor." - (interactive) - (setq url (concat "https://daemons.cf/stories/mi-configuracin-de-emacs/#" - (cdr (car (org-entry-properties (point) "CUSTOM_ID"))))) - (message url) - (kill-new url) - )) + (defun nikola/url-config () + "Devuelve el enlace de la parte de la configuración en la que esté el cursor." + (interactive) + (setq url (concat "https://daemons.it/stories/mi-configuracin-de-emacs/#" + (cdr (car (org-entry-properties (point) "CUSTOM_ID"))))) + (message url) + (kill-new url))) #+END_SRC **** Notas a pie de página @@ -2162,19 +2279,50 @@ A diferencia de la función de writequit, esta establece el título como custom\ :CUSTOM_ID: Temas para exportación en html :END: #+BEGIN_SRC emacs-lisp - (add-to-list 'el-get-sources '(:name org-html-themes - :type github - :pkgname "fniessen/org-html-themes" - )) +(add-to-list 'el-get-sources '(:name org-html-themes + :type github + :pkgname "fniessen/org-html-themes")) - (if (not (el-get-package-installed-p 'org-html-themes)) - (el-get 'sync 'org-html-themes) - ) +(if (not (el-get-package-installed-p 'org-html-themes)) + (el-get 'sync 'org-html-themes)) +#+END_SRC +**** Ejecución de bloques babel asyncrona +:PROPERTIES: +:CUSTOM_ID: Ejecución de bloques babel asyncrona +:END: +#+name: ob-async +#+BEGIN_SRC emacs-lisp +(add-to-list 'el-get-sources '(:name ob-async + :type github + :pkgname "astahlman/ob-async")) + +(if (not (el-get-package-installed-p 'ob-async)) + (el-get 'sync 'ob-async)) + +(use-package ob-async + :load-path "el-get/ob-async/" + :config + (add-to-list 'org-ctrl-c-ctrl-c-hook 'ob-async-org-babel-execute-src-block)) +#+END_SRC +**** org-brain +#+BEGIN_SRC emacs-lisp +(add-to-list 'el-get-sources '(:name org-brain + :type github + :pkgname "Kungsgeten/org-brain")) + +(if (not (el-get-package-installed-p 'org-brain)) + (el-get 'sync 'org-brain)) + +(use-package org-brain + :load-path "el-get/org-brain" + :config + (setq org-brain-path "~/Documentos/org/brain/")) #+END_SRC ** mail-mode :PROPERTIES: :CUSTOM_ID: mail-mode :END: +Para que cuadre con mutt. #+BEGIN_SRC emacs-lisp (add-to-list 'auto-mode-alist '(".*mutt-" . mail-mode)) #+END_SRC @@ -2183,15 +2331,32 @@ A diferencia de la función de writequit, esta establece el título como custom\ :CUSTOM_ID: lisp :END: *** Paredit +:PROPERTIES: +:CUSTOM_ID: Paredit +:END: #+BEGIN_SRC emacs-lisp (use-package paredit :ensure t) #+END_SRC *** package-lint +:PROPERTIES: +:CUSTOM_ID: package-lint +:END: +Comprueba fallos y convenciones. #+BEGIN_SRC emacs-lisp (use-package package-lint :ensure t) #+END_SRC +*** rainbow-delimiters +:PROPERTIES: +:CUSTOM_ID: rainbow-delimiters +:END: +#+BEGIN_SRC emacs-lisp :tangle no +(use-package rainbow-delimiters + :ensure t + :config + (add-to-list 'auto-mode-alist '("\\.el\\'" . rainbow-delimiters-mode))) +#+END_SRC * Funciones personalizadas :PROPERTIES: :CUSTOM_ID: Funciones personalizadas @@ -2297,7 +2462,7 @@ Además, funciona tanto sin ninguna región activa cómo con esta. De haber regi :PROPERTIES: :CUSTOM_ID: Insertar org-entities :END: -Más información [[http://daemons.cf/posts/cosillas-de-emacs-escapar-simbolos-al-usar-usar-marcado-en-org-mode][aquí]]. +Más información [[http://daemons.it/posts/cosillas-de-emacs-escapar-simbolos-al-usar-usar-marcado-en-org-mode][aquí]]. #+name:insertar-entidades #+BEGIN_SRC emacs-lisp diff --git a/emacs.d/init.el b/emacs.d/init.el index 5c97ddd..b8327f0 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -1,4 +1,11 @@ ;; Antes que nada, quitamos del path el org-mode que viene con emacs, por que es viejo + +;; Added by Package.el. This must come before configurations of +;; installed packages. Don't delete this line. If you don't want it, +;; just comment it out by adding a semicolon to the start of the line. +;; You may delete these explanatory comments. +(package-initialize) + (dolist (val load-path) (if (string-match "lisp\/org" val) (progn @@ -18,6 +25,17 @@ (message "Evaluating private-literate.org") (org-babel-load-file (concat user-emacs-directory "private-literate.org")) (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. '(custom-safe-themes (quote ("71ecffba18621354a1be303687f33b84788e13f40141580fa81e7840752d31bf" default)))) +(put 'upcase-region 'disabled nil) +(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. + '(default ((t (:family "DejaVu Sans Mono" :foundry "unknown" :slant normal :weight normal :height 107 :width normal))))) diff --git a/instala.sh b/instala.sh index 0f8714e..9c499fb 100755 --- a/instala.sh +++ b/instala.sh @@ -16,112 +16,234 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if [[ $1 = "all" ]] -then - bash instala.sh X - bash instala.sh i3 - bash instala.sh tmux - bash instala.sh qutebrowser - bash instala.sh emacs +os=$(grep "^ID" /etc/os-release | cut -d'=' -f2) +root=$(pwd) -elif [[ $1 = "X" ]] +if [[ $os = "slackware" ]] then - ln -sf $(pwd)/Xdefaults $HOME/.Xdefaults - ln -sf $(pwd)/Xmodmap $HOME/.Xmodmap - ln -s $(pwd)/compton.conf $HOME/.compton.conf -elif [[ $1 = "i3" ]] + instalador="sbopkg -i " +elif [[ $os = "debian" ]] then - ln -sf $(pwd)/i3 $HOME/.i3 - ln -sf $(pwd)/i3/i3blocks.conf $HOME/.i3blocks.conf - -elif [[ $1 = "mutt" ]] -then - ln -sf $(pwd)/mutt $HOME/.mutt - ln -sf $(pwd)/mutt/muttrc.example $HOME/.muttrc - ln -sf $(pwd)/mutt/offlineimaprc.example $HOME/.offlineimaprc - -elif [[ $1 = "tmux" ]] -then - ln -sf $(pwd)/tmux.conf $HOME/.tmux.conf - -elif [[ $1 = "qutebrowser" ]] -then - mkdir -p $HOME/.config/qutebrowser/ - ln -sf $(pwd)/qutebrowser/{qutebrowser.conf,keys.conf} $HOME/.config/qutebrowser/ - echo "Necesito permiso de superusuaria para copiar los archivos hosts, capture y umpv a su sitio." - sudo ln -sf $(pwd)/qutebrowser/{capture,umpv} /usr/local/bin/ - sudo ln -sf $(pwd)/qutebrwoser/hosts/ /etc/hosts - -elif [[ $1 = "emacs" ]] -then - # Establece el directorio de las configuraciones, lo crea y las copia ahí - EMACSDIR="$HOME/.emacs.d" - mkdir -p $EMACSDIR - ln -sf $(pwd)/emacs.d/{init.el,init-literate.org} $EMACSDIR - - # crear private-literate.org si no existe para que no se queje init.el - if [[ ! -e $EMACSDIR/private-literate.org ]] - then - echo -e "* Vacio\n#+BEGIN_SRC emacs-lisp\n#+END_SRC" > $EMACSDIR/private-literate.org - fi - - # Instalar todos los paquetes de emacs - emacs -Q --batch --eval "(load-file \""$EMACSDIR/"init.el\")" - - # Por algún motivo al compilar desde el-get mete una ruta incorrecta en org-loaddefs.el - find $EMACSDIR -name 'org-loaddefs.el' | xargs sed -i "s,org-mode-maint/lisp/,,g" - - # Necesito permiso de superusuario para copiar los scripts capture y demacs en /usr/local/bin/ - sudo ln -sf $(pwd)/emacs.d/{capture,demacs} /usr/local/bin/ -elif [[ $1 = "fonts" ]] -then - FONTDIR="$HOME/.local/share/fonts" - mkdir -p $HOME/.local/share/ - ln -fs $(pwd)/fonts/ $HOME/.local/share/ - fc-cache -fv $FONTDIR - # las cuatro siguientes no se si son necesarias, pero es gratis ponerlas - fc-cache -fv $FONTDIR/misc - fc-cache -fv $FONTDIR/ohsnap - fc-cache -fv $FONTDIR/tewi - fc-cache -fv $FONTDIR/terminesspowerline - xset +fp $FONTDIR/ - # las cuatro siguientes no se si son necesarias, pero es gratis ponerlas - xset +fp $FONTDIR/misc - xset +fp $FONTDIR/ohsnap - xset +fp $FONTDIR/tewi - xset +fp $FONTDIR/terminesspowerline - xset fp rehash -elif [[ $1 = "pypi" ]] -then - sudo pip3 install rope importmagic autopep8 yapf Nikola Nikola[extras] mps-youtube youtube-dl speedtest-cli twine setuptools - sudo pip2 install rope importmagic autopep8 yapf virtualenv virtualenvwrapper setuptools - echo """ - export WORKON_HOME=~/.virtualenvs - mkdir -p $WORKON_HOME - source `which virtualenvwrapper.sh` > /dev/null - """ >> $HOME/.bashrc - echo """ - export WORKON_HOME=~/.virtualenvs - mkdir -p $WORKON_HOME - source `which virtualenvwrapper.sh` > /dev/null - """ >> $HOME/.zshrc - export WORKON_HOME=~/.virtualenvs - source `which virtualenvwrapper.sh` - echo "pip install jedi rope importmagic autopep8 yapf" >> $WORKON_HOME/postmkvirtualenv -elif [[ $1 = "shell" ]] -then - if [[ ! -d $HOME/.oh-my-zsh ]] - then - git clone git://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh - chsh -s /bin/zsh - fi - ln -sf $(pwd)/shell/zsh_custom_themes/* $HOME/.oh-my-zsh/custom/themes/ - ln -sf $(pwd)/shell/aliases $HOME/.aliases - ln -sf $(pwd)/shell/bashrc $HOME/.bashrc - ln -sf $(pwd)/shell/zshrc $HOME/.zshrc -elif [[ $1 = "" ]] -then - echo "./instala.sh {all, X, i3, tmux, qutebrowser, emacs, fonts, pypi, shell}" + instalador="apt-get install " else - echo "No existe ese parámetro. Escoge: {all, X, i3, tmux, qutebrowser, emacs, fonts, pypi, shell}" + echo "No se soporta este SO, a cascarla." + exit 1 +fi +# da error, mirar +if [[ $1 = "conf" ]] +then + if [[ $2 = "all" ]] + then + bash instala.sh conf X + bash instala.sh conf i3 + bash instala.sh conf tmux + bash instala.sh conf qutebrowser + bash instala.sh conf emacs + bash instala.sh conf fonts + bash instala.sh conf pypi + + elif [[ $2 = "X" ]] + then + ln -sf $(pwd)/Xdefaults $HOME/.Xdefaults + ln -sf $(pwd)/Xmodmap $HOME/.Xmodmap + ln -s $(pwd)/compton.conf $HOME/.compton.conf + + elif [[ $2 = "i3" ]] + then + ln -sf $(pwd)/i3 $HOME/.i3 + ln -sf $(pwd)/i3/i3blocks.conf $HOME/.i3blocks.conf + + elif [[ $2 = "neomutt" ]] + then + ln -sf $(pwd)/mutt $HOME/.mutt + ln -sf $(pwd)/mutt/muttrc.example $HOME/.muttrc + ln -sf $(pwd)/mutt/offlineimaprc.example $HOME/.offlineimaprc + + elif [[ $2 = "tmux" ]] + then + ln -sf $(pwd)/tmux.conf $HOME/.tmux.conf + + elif [[ $2 = "qutebrowser" ]] + then + mkdir -p $HOME/.config/qutebrowser/ + ln -sf $(pwd)/qutebrowser/{qutebrowser.conf,keys.conf} $HOME/.config/qutebrowser/ + echo "Necesito permiso de superusuaria para copiar los archivos hosts, capture y umpv a su sitio." + #sudo ln -sf $(pwd)/qutebrowser/{capture,umpv} /usr/local/bin/ + #sudo ln -sf $(pwd)/qutebrwoser/hosts/ /etc/hosts + + elif [[ $2 = "emacs" ]] + then + # Establece el directorio de las configuraciones, lo crea y las copia ahí + EMACSDIR="$HOME/.emacs.d" + mkdir -p $EMACSDIR + ln -sf $(pwd)/emacs.d/{init.el,init-literate.org} $EMACSDIR + + # crear private-literate.org si no existe para que no se queje init.el + if [[ ! -e $EMACSDIR/private-literate.org ]] + then + echo -e "* Vacio\n#+BEGIN_SRC emacs-lisp\n#+END_SRC" > $EMACSDIR/private-literate.org + fi + + # Instalar todos los paquetes de emacs + emacs -Q --batch --eval "(load-file \""$EMACSDIR/"init.el\")" + + # Por algún motivo al compilar desde el-get mete una ruta incorrecta en org-loaddefs.el + sed -i "s,org-mode-maint/lisp/,,g" $EMACSDIR/el-get/org-mode-maint/lisp/org-loaddefs.el + + echo "Necesito permiso de superusuario para copiar los scripts capture y demacs en /usr/local/bin/" + #sudo ln -sf $(pwd)/emacs.d/{capture,demacs} /usr/local/bin/ + + elif [[ $2 = "shell" ]] + then + ln -sf $(pwd)/shell/zsh_custom_themes/* $HOME/.oh-my-zsh/custom/themes/ + ln -sf $(pwd)/shell/aliases $HOME/.aliases + ln -sf $(pwd)/shell/bashrc $HOME/.bashrc + ln -sf $(pwd)/shell/zshrc $HOME/.zshrc + + elif [[ $2 = "pypi" ]] + then + echo """ + export WORKON_HOME=~/.virtualenvs + mkdir -p $WORKON_HOME + source `which virtualenvwrapper.sh` > /dev/null + """ >> $HOME/.bashrc + echo """ + export WORKON_HOME=~/.virtualenvs + mkdir -p $WORKON_HOME + source `which virtualenvwrapper.sh` > /dev/null + """ >> $HOME/.zshrc + export WORKON_HOME=~/.virtualenvs + source `which virtualenvwrapper.sh` + echo "pip install jedi rope importmagic autopep8 yapf" >> $WORKON_HOME/postmkvirtualenv + + elif [[ $2 = "" ]] + then + echo "./instala.sh conf {all, X, i3, tmux, qutebrowser, emacs, shell, pypi}" + else + echo "No existe ese parámetro. Escoge: {all, X, i3, tmux, qutebrowser, emacs, shell, pypi}" + fi + +elif [[ $1 = "prog" ]] +then + if [[ $2 = "all" ]] + then + bash instala.sh prog i3 + bash instala.sh prog mutt + bash instala.sh prog tmux + bash instala.sh prog qutebrowser + bash instala.sh prog emacs + bash instala.sh prog fonts + bash instala.sh prog pypi + bash instala.sh prog shell + cat /tmp/dotfiles_construido + + elif [[ $2 = "i3" ]] + then + git clone --recursive https://github.com/Airblader/xcb-util-xrm.git $root/programas/xcb-util-xrm + cd $root/programas/xcb-util-xrm + ./autogen.sh + ./configure + make && echo "$2 construido correctamente" > /tmp/dotfiles_construido + #sudo make install + + git clone https://github.com/Airblader/i3 $root/programas/i3-gaps + cd $root/programas/i3-gaps/ + git checkout gaps-next + autoreconf --force --install + mkdir -p build && cd build/ + autoreconf --force --install + ../configure --prefix=/usr/local --sysconfdir=/etc --disable-sanitizers + make && echo "$2 construido correctamente" >> /tmp/dotfiles_construido + #sudo make install + + git clone https://github.com/Airblader/i3blocks-gaps $root/programas/i3blocks-gaps/ + cd $root/programas/i3blocks-gaps/ + make all && echo "$2 construido correctamente" >> /tmp/dotfiles_construido + #sudo make install + echo "Puede que falten más dependencias, depende de la distro. Deberian estar todas en los repositorios oficiales." + + elif [[ $2 = "mutt" ]] + then + git clone https://github.com/neomutt/neomutt $root/programas/neomutt/ + cd $root/programas/neomutt/ + ./prepare --prefix=/usr/local --sysconfdir=/etc --enable-debug --enable-notmuch --enable-smtp --enable-hcache --enable-sidebar --with-ssl=/usr --with-curses=/usr --with-regex --with-sasl --enable-imap --enable-pop --with-idn --enable-gpgme --with-gpgme-prefix=/usr/ --disable-fmemopen + # make && echo "$2 construido correctamente" >> /tmp/dotfiles_construido + #sudo make install + + elif [[ $2 = "tmux" ]] + then + # if [[ $os = "slackware" ]] + # then + # #sudo slackpkg install tmux + # else + # #sudo apt-get install tmux + echo lol1 + + elif [[ $2 = "qutebrowser" ]] + then + $instalador libxkbcommon libinput qt5 qt5-webkit python3-PyQt5 python3-sip + #sudo pip3 install qutebrowser + + elif [[ $2 = "emacs" ]] + then + git clone git://git.sv.gnu.org/emacs.git $root/programas/emacs/ + cd $root/programas/emacs/ + git checkout -b emacs-25 + ./autogen.sh + ./configure + make bootstrap && echo "$2 construido correctamente" >> /tmp/dotfiles_construido + #sudo make install + + elif [[ $2 = "fonts" ]] + then + FONTDIR="$HOME/.local/share/fonts" + mkdir -p $HOME/.local/share/ + ln -fs $(pwd)/fonts/ $HOME/.local/share/ + fc-cache -fv $FONTDIR + # las cuatro siguientes no se si son necesarias, pero es gratis ponerlas + fc-cache -fv $FONTDIR/misc + fc-cache -fv $FONTDIR/ohsnap + fc-cache -fv $FONTDIR/tewi + fc-cache -fv $FONTDIR/terminesspowerline + xset +fp $FONTDIR/ + # las cuatro siguientes no se si son necesarias, pero es gratis ponerlas + xset +fp $FONTDIR/misc + xset +fp $FONTDIR/ohsnap + xset +fp $FONTDIR/tewi + xset +fp $FONTDIR/terminesspowerline + xset fp rehash + + elif [[ $2 = "pypi" ]] + then + echo lol2 + #sudo pip3 install rope importmagic autopep8 yapf Nikola Nikola[extras] mps-youtube youtube-dl speedtest-cli twine setuptools + #sudo pip2 install rope importmagic autopep8 yapf virtualenv virtualenvwrapper setuptools + + elif [[ $2 = "shell" ]] + then + git clone https://github.com/thestinger/vte-ng $root/programas/vte-ng/ + cd $root/programas/vte-ng + ./autogen.sh + ./configure + make && echo "$2 construido correctamente" >> /tmp/dotfiles_construido + #sudo make install + + git clone https://github.com/thestinger/termite.git $root/programas/termite/ + cd $root/programas/termite + ./autogen.sh + ./configure + make && echo "$2 construido correctamente" >> /tmp/dotfiles_construido + #sudo make install + cd $root + + git clone https://github.com/robbyrussell/oh-my-zsh.git $root/programas/oh-my-zsh/ + ln -s $root/programas/oh-my-zsh/ $HOME/.oh-my-zsh/ + chsh -s /bin/zsh + + elif [[ $2 = "" ]] + then + echo "./instala.sh conf {all, X, i3, tmux, qutebrowser, emacs, fonts, pypi, shell}" + else + echo "No existe ese parámetro. Escoge: {all, X, i3, tmux, qutebrowser, emacs, fonts, pypi, shell}" + fi fi diff --git a/qutebrowser/keys.conf b/qutebrowser/keys.conf index f89a981..8c6f46a 100644 --- a/qutebrowser/keys.conf +++ b/qutebrowser/keys.conf @@ -440,13 +440,13 @@ enter-mode caret v enter-mode passthrough - + scroll-page 0 1 - + scroll-page 0 -1 - + scroll-page 0 0.5 diff --git a/shell/aliases b/shell/aliases index 2de64e9..77c7799 100644 --- a/shell/aliases +++ b/shell/aliases @@ -12,4 +12,6 @@ gdp () { git diff `git log --pretty=format:"%h" | head -n$1 | tail -n1`; } alias cal="cal -m" alias nav="qutebrowser --target tab-bg-silent " alias venv="source `which virtualenvwrapper.sh` > /dev/null && workon " -alias kpcli="cd ~/Documentos; kpcli" +alias kpcli="cd ~/Documentos; kpcli; cd -" +alias paste='torify curl -F '\''sprunge=<-'\'' http://sprunge.us' +alias captura="id=`genpass 5`; scrot -d 5 /tmp/$id.png; notify-send 'Captura hecha'; upload /tmp/$id.png; rm /tmp/$id.png" diff --git a/shell/zshrc b/shell/zshrc index 861bd8f..d50ef58 100644 --- a/shell/zshrc +++ b/shell/zshrc @@ -58,3 +58,6 @@ mkdir -p $WORKON_HOME # Privado source ~/.sh_privado + +# unalias +unalias g