summaryrefslogtreecommitdiff
path: root/tramp-conf.el
blob: 183361bcc8e57a589642a57fb79be6dfc2432b20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
;;; tramp-conf.el --- Configurations of Tramp        -*- lexical-binding: t; -*-

;; Copyright (C) 2022  李俊緯

;; Author: 李俊緯 <mmemmew@gmail.com>
;; Keywords: comm, convenience, files, processes

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; My configurations of the wonderful Tramp.

;;; Code:

(require 'tramp)

;;; Fix a Tramp copy arg

(cond
 ((assoc "rsync" tramp-methods #'equal)
  (setcar
   (cdr
    (assoc
     'tramp-copy-args
     (assoc "rsync" tramp-methods #'equal)))
   (list
    (list "-t" "%k")
    (list "-p")
    (list "-r")
    ;; this option is invalid for my rsync program, for some reason
    ;; ("-s")
    (list "-c")))))

;;; Disable backups for Tramp

(add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil))

;;; Don't ask this over and over.

(setq tramp-allow-unsafe-temporary-files t)

;;; Disable version control on remote hosts

(setq
 vc-ignore-dir-regexp
 (format "\\(%s\\)\\|\\(%s\\)"
         vc-ignore-dir-regexp tramp-file-name-regexp))

(provide 'tramp-conf)
;;; tramp-conf.el ends here