Blame


1 56142b9f 2021-05-26 op # vmd.el
2 56142b9f 2021-05-26 op
3 56142b9f 2021-05-26 op vmd is an Emacs package to interact with [OpenBSD' vmd][vmd].
4 56142b9f 2021-05-26 op
5 12537540 2021-05-26 op ![vmd buffer with transient open](vmd.png)
6 56142b9f 2021-05-26 op
7 b69e2e9a 2021-05-26 op In a `*vmd*` buffer (opened with `M-x vmd RET`), the following keys
8 b69e2e9a 2021-05-26 op are defined:
9 12537540 2021-05-26 op
10 b69e2e9a 2021-05-26 op - `c`: (console) open a terminal connected to the vm at point
11 b69e2e9a 2021-05-26 op - `P`: pause the vm at point
12 b69e2e9a 2021-05-26 op - `s`: start the vm at point
13 b69e2e9a 2021-05-26 op - `S`: stop the vm at point
14 b69e2e9a 2021-05-26 op - `u`: unpause the vm at point
15 b69e2e9a 2021-05-26 op
16 b69e2e9a 2021-05-26 op additionally, `x` will bring up a transient popup with the mnemonics
17 b69e2e9a 2021-05-26 op for the keys.
18 b69e2e9a 2021-05-26 op
19 b69e2e9a 2021-05-26 op
20 5aee7cf1 2021-05-26 op ### Customize the terminal for the console
21 24b53322 2021-05-26 op
22 24b53322 2021-05-26 op To use vterm (or any other packages really) to handle a shell for the
23 24b53322 2021-05-26 op console, `vmd-console-function` must point to a function that accepts
24 24b53322 2021-05-26 op two parameters, name and cmd, and execute cmd (a list of strings) in
25 24b53322 2021-05-26 op your preferred terminal. By default, `ansi-term` (bundled with Emacs)
26 5aee7cf1 2021-05-26 op is used, so it's easy to switch e.g. to vterm:
27 24b53322 2021-05-26 op
28 24b53322 2021-05-26 op ```elisp
29 24b53322 2021-05-26 op (defun my/vmd-vterm (name cmd)
30 24b53322 2021-05-26 op (let ((vterm-shell (mapconcat #'shell-quote-argument cmd " "))
31 24b53322 2021-05-26 op (vterm-buffer-name (concat "*" name "*")))
32 24b53322 2021-05-26 op (vterm)))
33 24b53322 2021-05-26 op (setq vmd-console-function #'my/vmd-vterm)
34 24b53322 2021-05-26 op ```
35 24b53322 2021-05-26 op
36 24b53322 2021-05-26 op
37 56142b9f 2021-05-26 op [vmd]: http://man.openbsd.org/vmd