summaryrefslogtreecommitdiff
path: root/config.el
diff options
context:
space:
mode:
authorLibravatar Terin Stock <terinjokes@gmail.com>2026-09-26 03:22:34 +0200
committerLibravatar Terin Stock <terinjokes@gmail.com>2026-09-26 03:22:34 +0200
commit4bad80bea093b52222d19509141d74bb063cbb89 (patch)
tree0f36d34467de9e8f68f32234d11f3ae5780a6512 /config.el
parentfix(with-editor): add hook for eat (diff)
downloaddoom-emacs-4bad80bea093b52222d19509141d74bb063cbb89.tar.xz
feat(tramp): enable and use run0 method
Diffstat (limited to 'config.el')
-rw-r--r--config.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/config.el b/config.el
index 2e35cb3..c1be7da 100644
--- a/config.el
+++ b/config.el
@@ -89,3 +89,17 @@
(use-package! meson-mode)
(use-package! ebuild-mode)
+(after! tramp
+ (tramp-enable-run0-method)
+
+ (defun doom--sudo-file-path (file)
+ (let ((host (or (file-remote-p file 'host) "localhost")))
+ (concat "/"
+ (when (file-remote-p file)
+ (concat (file-remote-p file 'method) ":"
+ (if-let* ((user (file-remote-p file 'user)))
+ (concat user "@" host)
+ host)
+ "|"))
+ "run0:root@" host ":"
+ (or (file-remote-p file 'localname) file)))))