From 8711828fbeb8ffb24eb8104003b04f62e75f08f2 Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Sat, 14 Sep 2019 02:36:45 -0500 Subject: [PATCH] Fixed tramp for android and added lispy mode --- custom.el | 5 +++-- settings.org | 39 ++++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/custom.el b/custom.el index f83f8c3..06510c2 100644 --- a/custom.el +++ b/custom.el @@ -9,8 +9,9 @@ '(elpy-eldoc-show-current-function nil) '(package-selected-packages (quote - (ibuffer-vc ag string-inflection tiny powershell diffview ivy-hydra window-numbering php-mode swiper mode-line-bell htmlize cython-mode blacken dired-narrow lua-mode browse-kill-ring clipmon free-keys org-link-minor-mode js2-mode js2-refactor xref-js2 python-django visual-regexp-steroids pcre2el vimrc-mode iedit transient magit dracula-theme flycheck elpy ein better-defaults ssh-config-mode yaml-mode apache-mode web-mode undo-tree))) - '(reb-re-syntax (quote string))) + (kv lispy ibuffer-vc ag string-inflection tiny powershell diffview ivy-hydra window-numbering php-mode swiper mode-line-bell htmlize cython-mode blacken dired-narrow lua-mode browse-kill-ring clipmon free-keys org-link-minor-mode js2-mode js2-refactor xref-js2 python-django visual-regexp-steroids pcre2el vimrc-mode iedit transient magit dracula-theme flycheck elpy ein better-defaults ssh-config-mode yaml-mode apache-mode web-mode undo-tree))) + '(reb-re-syntax (quote string)) + '(tramp-use-ssh-controlmaster-options nil nil (tramp))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/settings.org b/settings.org index 80de698..7993c56 100644 --- a/settings.org +++ b/settings.org @@ -193,27 +193,28 @@ (setq dired-listing-switches "-alh") #+end_src * Tramp configuration +** Tramp append plist to connection properties +#+BEGIN_SRC emacs-lisp +(require 'kv) +(defun rlbr/add-config-to-tramp (matches-regexp config-plist) + (let ((config-alist (kvplist->alist config-plist))) + (dolist (pair config-alist) + (let ((config (list + matches-regexp + (car pair) + (cdr pair)))) + (add-to-list + 'tramp-connection-properties + config))))) +#+END_SRC ** Android #+begin_src emacs-lisp -(let - ( - (default-directory "/data/data/com.termux/files/") - ) - (add-to-list 'tramp-connection-properties - (list - "/ssh:termux.*" - "tmpdir" (expand-file-name "temp/") - "remote-shell" (expand-file-name "usr/bin/sh") - "remote path" (append (mapcar 'expand-file-name '( - "home/.local/bin" - "usr/bin" - "usr/bin/applets" - )) - '("/sbin" - "/vendor/bin" - "/system/sbin" - "/system/bin" - "/system/xbin"))))) +(let ((android-config (let ((default-directory "/data/data/com.termux/files")) + (list "tmpdir" (expand-file-name "home/temp/") + "remote-shell" (expand-file-name "usr/bin/sh") + "remote-process-environment" (append (list (concat "PREFIX=" default-directory "usr")) tramp-remote-process-environment) + "remote-path" (append (mapcar 'expand-file-name '("home/.local/bin" "usr/bin" "usr/bin/applets")) '("/sbin" "/vendor/bin" "/system/sbin" "/system/bin" "/system/xbin")))))) + (rlbr/add-config-to-tramp "/ssh:termux.*:" android-config)) #+end_src * Web things ** javascript stuff