summaryrefslogtreecommitdiff
path: root/config.el
diff options
context:
space:
mode:
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)))))