diff --git a/emacs/.emacs.d/config/init-aws.el b/emacs/.emacs.d/config/init-aws.el index 3d78756..de323ec 100644 --- a/emacs/.emacs.d/config/init-aws.el +++ b/emacs/.emacs.d/config/init-aws.el @@ -13,16 +13,22 @@ (add-hook 'vterm-mode-hook #'aws-local-profile) (add-hook 'term-mode-hook #'aws-local-profile) -(setq aws-current-profile (getenv "AWS_PROFILE")) - (add-to-list 'aws-profiles "personal") (add-to-list 'aws-profiles "lola-cde") (defun aws-switch-profile (profile) (interactive (list (completing-read "Profile: " aws-profiles))) (setenv "AWS_PROFILE" profile) + (when (eq major-mode 'vterm-mode) + (vterm-send-C-e) + (vterm-send-C-u) + (vterm-send-string (format "export AWS_PROFILE=%s\n" profile))) (setq aws-current-profile profile)) +(add-hook 'emacs-startup-hook + (lambda () + (aws-switch-profile "default"))) + ;; A command to MFA to AWS (defun aws-mfa (mfa-token) (interactive (list