;;; tramp.el -*- lexical-binding: t; -*- (use-package! tramp :defer t :config ;; To “turn off” the backup feature for remote files and stop TRAMP from saving to the backup directory. ;; See https://www.gnu.org/software/tramp/#Auto_002dsave-File-Lock-and-Backup (add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil)) (customize-set-variable 'tramp-backup-directory-alist backup-directory-alist) (setq backup-enable-predicate (lambda (name) nil))) ;;;; TRAMP optimizations (after! tramp (setq tramp-default-method "ssh" ; Use SSH by default tramp-verbose 1 ; Reduce verbosity tramp-use-ssh-controlmaster-options nil ; Don't use control master tramp-chunksize 500 ; Bigger chunks for better performance tramp-connection-timeout 10 ; Shorter timeout ;; Use SSH configuration tramp-use-ssh-controlmaster-options nil ;; Cache remote files remote-file-name-inhibit-cache nil ;; Enable file-name-handler cache tramp-cache-read-persistent-data t)) ;; Additional performance settings (setq vc-ignore-dir-regexp (format "%s\\|%s" vc-ignore-dir-regexp tramp-file-name-regexp))