diff --git a/emacs/.emacs.d/config/init-aws.el b/emacs/.emacs.d/config/init-aws.el index 8b1d16d..0337446 100644 --- a/emacs/.emacs.d/config/init-aws.el +++ b/emacs/.emacs.d/config/init-aws.el @@ -28,6 +28,15 @@ (vterm-send-string (format "export AWS_PROFILE=%s\n" profile))) (setq aws-current-profile profile)) +(defun vterm-aws-switch-profile (profile) + "Switch the AWS profile for the current vterm command." + (interactive (list (completing-read "Profile: " (aws-list-profiles)))) + (vterm-send-C-a) + (vterm-send-string (format "AWS_PROFILE=%s " profile))) + +(with-eval-after-load 'vterm + (define-key vterm-mode-map (kbd "C-c a") #'vterm-aws-switch-profile)) + (defun aws-sso-login () (interactive) (let ((buffer "*aws-sso-login*"))