emacs-vterm-manager
emacs-vterm-manager copied to clipboard
Manages vterm buffers with configuration files.
#+TITLE: README [[https://melpa.org/#/vtm][file:https://melpa.org/packages/vtm-badge.svg]]
- About ~vtm~ manages ~vterm~ buffers with configuration files.
Especially useful when sshing to many hosts simultaneously.
#+CAPTION: vtm [[./screenshots/vtm.gif]]
- Features
- Name of the vterm buffer can be explicitly specified by configuration or implicitly infered from configuration file name. So users can switch between different vterm buffer easily.
- Multiple strings can be sent to vterm buffer by configuration.
- Control characters can be sent to vterm buffer by configuration.
- Time to sleep before sending string or control characters can be specified by configuration.
-
Install Just install ~vtm~ from ~melpa~.
-
Usage
- Create a /.vtm/ file (e.g. /host.vtm/), ~vtm~ will populate it with an example config.
- Edit the /.vtm/ file as your wish, then close the buffer.
- Open the /.vtm/ file like a normal file, a ~vterm~ buffer will be opened instead.
- Toggle ~vtm-edit-mode~ to switch between editing the /.vtm/ file and openning the ~vterm~ buffer.
Example /.vtm/ file #+BEGIN_SRC lisp ( ;; Buffer key name, default to "" (filename). :name ""
;; Commands to send, default to nil. :commands (
;; First command. ( ;; Sleep before command, default to 0. :sleep 0 ;; String to send, default to "". :string "" ;; Additional control character to send. ;; Possible values: ;; - "key" in command ~vterm-send-{key}~: send ~key~ ;; - "": send ~return~. ;; - nil: do not send control character. ;; Default to "" (send ~return~). :control "" )
;; ;; Second command. ;; (:sleep 0 :string "" :control "")
;; ;; Third command. ;; (:string "")
)) #+END_SRC
- Variables and commands | Variable | Description | Default | |----------------------+------------------------------------------+---------| | ~vtm-prefix-string~ | Prefix string of the vterm buffer name. | ~>~ | | ~vtm-postfix-string~ | Postfix string of the vterm buffer name. | ~~ | |----------------------+------------------------------------------+---------|