From fe6f69d1339d56ca1d580404f2572dbd066ea2bd Mon Sep 17 00:00:00 2001 From: drymer Date: Tue, 18 Apr 2017 05:22:10 +0000 Subject: [PATCH] Mejoras varias --- emacs.d/init-literate.org | 41 +++++++++++++++++++++++++++++++++++---- emacs.d/init.el | 2 +- i3/config.i3blocks | 2 +- instala.sh | 2 +- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/emacs.d/init-literate.org b/emacs.d/init-literate.org index b3b3c39..eafdc02 100644 --- a/emacs.d/init-literate.org +++ b/emacs.d/init-literate.org @@ -529,7 +529,8 @@ Auto-instala los docsets: (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))) + ("C-'" . ace-isearch-jump-during-isearch)) + :diminish ace-isearch-mode) #+END_SRC ** Seguir enlaces simbólicos @@ -636,7 +637,8 @@ torify git "$@" (use-package company :ensure t :config - (add-hook 'after-init-hook 'global-company-mode)) + (add-hook 'after-init-hook 'global-company-mode) + :diminish company-mode) #+END_SRC ** Borrar espacios sobrantes :PROPERTIES: @@ -1543,7 +1545,9 @@ La configuración de elpy: (el-get 'sync 'elpy)) (use-package elpy + :load-path "el-get/elpy/" :init + (use-package pyvenv :ensure t) (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") @@ -2580,8 +2584,38 @@ directory to make multiple eshell windows easier." :PROPERTIES: :CUSTOM_ID: Reabrir buffer con sudo :END: -Fuente: http://emacsredux.com/blog/2013/04/21/edit-files-as-root/ +Fuente: [[http://emacsredux.com/blog/2013/04/21/edit-files-as-root/][http://emacsredux.com/blog/2013/04/21/edit-files-as-root/]] +Fuente: [[http://stackoverflow.com/a/16408592][http://stackoverflow.com/a/16408592]] + +Es una mezcla de ambas fuentes. +#+name:abrir-sudo #+BEGIN_SRC emacs-lisp +(defadvice purpose-find-file-overload (after find-file-sudo activate) + "Find file as root if necessary." + (unless (and buffer-file-name + (file-writable-p buffer-file-name)) + + (let* ((buffer-file (buffer-file-name)) + (coincidence (string-match-p "@" buffer-file)) + (hostname) + (buffer-name)) + (if coincidence + (progn + (setq hostname (substring buffer-file (+ coincidence 1) + (string-match-p ":" buffer-file (+ coincidence 1)))) + (setq buffer-name + (concat + (substring buffer-file 0 coincidence) "@" + (replace-regexp-in-string ":" (concat "|sudo:" hostname ":") + buffer-file nil nil nil (+ coincidence 1)))) + (find-alternate-file buffer-name)) + (find-alternate-file (concat "/sudo:root@localhost:" buffer-file)))))) +#+END_SRC + +Antes usaba esto, ahora desactivado: + +#+name:abrir-sudo-viejo +#+BEGIN_SRC emacs-lisp :tangle no (defun sudo-edit (&optional arg) "Edit currently visited file as root. @@ -2593,5 +2627,4 @@ buffer is not visiting a file." (find-file (concat "/sudo:root@localhost:" (ido-read-file-name "Find file(as root): "))) (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name)))) - #+END_SRC diff --git a/emacs.d/init.el b/emacs.d/init.el index b8327f0..68eb40c 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -31,7 +31,7 @@ ;; If there is more than one, they won't work right. '(custom-safe-themes (quote - ("71ecffba18621354a1be303687f33b84788e13f40141580fa81e7840752d31bf" default)))) + ("71ecffba18621354a1be303687f33b84788e13f40141580fa81e7840752d31bf" default))) (put 'upcase-region 'disabled nil) (custom-set-faces ;; custom-set-faces was added by Custom. diff --git a/i3/config.i3blocks b/i3/config.i3blocks index 91884f9..ca841d8 100644 --- a/i3/config.i3blocks +++ b/i3/config.i3blocks @@ -26,7 +26,7 @@ bindsym $mod+Return exec termite bindsym $mod+Shift+Q kill # arrancar dmenu -bindsym $mod+d exec dmenu_run +bindsym $mod+d exec --no-startup-id rofi -show combi # Reinicia i3 bindsym $mod+Shift+r restart diff --git a/instala.sh b/instala.sh index 9c499fb..b6240a6 100755 --- a/instala.sh +++ b/instala.sh @@ -181,7 +181,7 @@ then elif [[ $2 = "qutebrowser" ]] then - $instalador libxkbcommon libinput qt5 qt5-webkit python3-PyQt5 python3-sip + sudo $instalador libxkbcommon libinput qt5 qt5-webkit python3-PyQt5 python3-sip #sudo pip3 install qutebrowser elif [[ $2 = "emacs" ]]