summaryrefslogtreecommitdiff
path: root/modules/tramp-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /modules/tramp-config.el
new repository
Diffstat (limited to 'modules/tramp-config.el')
-rw-r--r--modules/tramp-config.el52
1 files changed, 52 insertions, 0 deletions
diff --git a/modules/tramp-config.el b/modules/tramp-config.el
new file mode 100644
index 00000000..0ae52db3
--- /dev/null
+++ b/modules/tramp-config.el
@@ -0,0 +1,52 @@
+;;; tramp-config.el --- Tramp Configuration -*- lexical-binding: t; -*-
+
+;;; Commentary:
+;;
+;; TRAMP NOTES:
+;; note that you should disable your fancy prompt if connecting to the
+;; remote server from tramp. Here's what to add to the top of the file
+
+;; [[ $TERM == "dumb" ]] && PS1='$ ' && return
+;; [[ $TERM == "tramp" ]] && PS1='$ ' && return
+
+;;; Code:
+
+(use-package tramp
+ :defer .5
+ :ensure nil ;; built-in
+ :config
+ ;; uncomment for better debugging
+ ;; (setq tramp-debug-buffer t)
+ ;; (setq tramp-verbose 10)
+
+ ;; terminal type reported by tramp to host
+ (setq tramp-terminal-type "dumb")
+
+ ;; use the path assigned to the remote user by the remote host
+ (add-to-list 'tramp-remote-path 'tramp-own-remote-path)
+
+ ;; store auto-save files locally.
+ (setq tramp-auto-save-directory
+ (expand-file-name "tramp-auto-save" user-emacs-directory))
+
+ ;; turn off the backup "$filename~" feature for remote files
+ (setq remote-file-name-inhibit-auto-save-visited t)
+ (add-to-list 'backup-directory-alist
+ (cons tramp-file-name-regexp nil))
+
+ ;; set a more representative name for the persistency file.
+ (setq tramp-persistency-file-name
+ (expand-file-name "tramp-connection-history" user-emacs-directory))
+
+ (setq tramp-copy-size-limit nil) ;; always use external program to copy
+ (setq remote-file-name-inhibit-cache nil) ;; avoid cache invalidation
+
+ ;; cache and don't expire passwords
+ (setq password-cache t)
+ (setq password-cache-expiry nil)
+
+ ;; don't determine remote files vc status (for a performance gain)
+ (setq vc-ignore-dir-regexp tramp-file-name-regexp))
+
+(provide 'tramp-config)
+;;; tramp-config.el ends here