commit db27f7bde44951c71bab0e74568341c8f17d4409 parent 5772757557d70f2a03afe31cd335bd883d1812f7 Author: Vincent Demeester <vincent@sbr.pm> Date: Wed, 22 Jul 2020 19:03:40 +0200 tools/emacs: add a run-in-vterm command Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | tools/emacs/config/config-shells.el | | | 11 | +++++++++-- |
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/emacs/config/config-shells.el b/tools/emacs/config/config-shells.el @@ -255,7 +255,8 @@ using either KUBECONFIG or ~/.kube/config" (use-package vterm :commands (vterm vde/vterm-toggle) - :bind ("C-c t t" . vde/vterm-toggle) + :bind (("C-c t t" . vde/vterm-toggle) + ("C-c t r" . vde/run-in-vterm)) :custom (vterm-kill-buffer-on-exit t) :config @@ -278,7 +279,13 @@ toggle, the current window configuration is saved in a register." (other-window 1) (vterm 1) (other-window 1)))) - (window-configuration-to-register ?Z)))) + (window-configuration-to-register ?Z))) + (buffer-name) + (defun vde/run-in-vterm () + (interactive) + (with-current-buffer "vterm" + (vterm-send-string (read-string "Command: ")) + (vterm-send-C-j)))) ;; for fish in ansi-term (add-hook 'term-mode-hook 'toggle-truncate-lines)