Add ability to edit vterm command in buffer

This commit is contained in:
Jeremy Dormitzer 2023-09-26 10:21:35 -04:00
parent 373cf299e9
commit 8d695f3998
2 changed files with 11 additions and 0 deletions

View File

@ -41,8 +41,14 @@
(comint-send-invisible "Enter password: ")
(vterm-send-string "\n")
(clear-this-command-keys))
(defun vterm-edit-zsh-command-line ()
"Edit the current command line in a temp buffer."
(interactive)
(vterm-send-C-x)
(vterm-send-C-e))
:general
(leader-map "v" #'project-vterm)
(vterm-mode-map "C-x C-e" #'vterm-edit-zsh-command-line)
:custom
(vterm-max-scrollback 10000)
(vterm-environment '("TYPEWRITTEN_CURSOR=terminal"))

View File

@ -128,6 +128,11 @@ fi
# kubectl completion
[[ $commands[kubectl] ]] && source <(kubectl completion zsh)
# edit the current command line in $EDITOR
autoload -U edit-command-line
zle -N edit-command-line
bindkey '\C-x\C-e' edit-command-line
# VTerm integration
# Some of the most useful features in emacs-libvterm require shell-side
# configurations. The main goal of these additional functions is to enable the