|#lang tmux-vim-demo||package: tmux-vim-demo|
This language provides a convenient way to run a demo.
Implementation detail: The script is parsed by the racket reader. The result is mostly ignored, but text which causes the racket reader to error (such as imbalanced parentheses) may cause this language’s reader to bail. My best advice for such issues is currently to use the #; and #| |# commenting forms.
Running a program in this language will spawn a new tmux session with a shell on the left and Vim (in readonly mode by default) on the right. Vim will have two keybindings: Normal-mode r sends the line under the cursor to the shell and moves down a line. Visual-mode r does the same for the visually-selected lines.
If the #:pre directive is given, the corresponding commands will be given to tmux new-session: the shell pane on the left will be replaced with the result of those commands.
If the #:demo? directive is given it controls whether Vim will be in readonly mode. The value #t (the default) means readonly mode while #f means read-write mode.
Keybindings require tpope/vim-tbone to be installed in Vim, or at least a compatible definition of :Twrite. Technically the programs produced by this language will run without it; however, the r keybindings will produce errors.
#:name session name (string)
#:dir directory for demo (string)
#:pre commands for shell (string)
#:demo? readonly mode? (boolean)
|(require tmux-vim-demo)||package: tmux-vim-demo|
If name is #f, uses the base-name of filename.
If dir is #f, uses the user’s home directory.
If pre-commands is #f, lets tmux spawn a shell or its default-command. Otherwise, they are given to new-session.
If demo?, run view (Vim in readonly mode). Otherwise, run vim.