Configure auth-source-pass
This commit is contained in:
parent
3d75bee174
commit
1e0976215c
@ -336,6 +336,19 @@
|
|||||||
(add-hook 'yaml-mode-hook
|
(add-hook 'yaml-mode-hook
|
||||||
(lambda () (setq-local show-trailing-whitespace t))))
|
(lambda () (setq-local show-trailing-whitespace t))))
|
||||||
|
|
||||||
|
(use-package auth-source-pass :demand
|
||||||
|
:config
|
||||||
|
(auth-source-pass-enable)
|
||||||
|
(defun auth-source-pass--remap (orig-fun host &optional user port)
|
||||||
|
(let ((new-host (pcase host
|
||||||
|
("hosting" "hosting.tardisventures.net")
|
||||||
|
(_ host)))
|
||||||
|
(new-user (if (string= port "sudo") (user-login-name) user)))
|
||||||
|
(message "remapped %s@%s:%s -> %s@%s:%s" host user port new-host new-user port)
|
||||||
|
(funcall orig-fun new-host new-user port)))
|
||||||
|
|
||||||
|
(advice-add 'auth-source-pass--find-match-unambiguous :around #'auth-source-pass--remap))
|
||||||
|
|
||||||
(use-package calc
|
(use-package calc
|
||||||
:bind ("C-x M-e" . calc-eval-in-place)
|
:bind ("C-x M-e" . calc-eval-in-place)
|
||||||
:init
|
:init
|
||||||
|
Loading…
Reference in New Issue
Block a user