diff options
| author | James Cash <james.nvc@gmail.com> | 2020-08-17 14:27:33 -0400 |
|---|---|---|
| committer | James N. V. Cash <james.nvc@gmail.com> | 2020-08-21 12:59:21 -0400 |
| commit | 0a1178d5e14fa561cd11cd456279136ea452624d (patch) | |
| tree | 0006150168c6bd28f9b402a38daec71f44b731e7 /README.md | |
| parent | 797357bf65952337627f2d0c594c2fef600aafae (diff) | |
Add implementation of vterm_cmd helper for fish
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -486,6 +486,8 @@ The commands that are understood are defined in the setting `vterm-eval-cmds`. As `split-string-and-unquote` is used the parse the passed string, double quotes and backslashes need to be escaped via backslash. A convenient shell function to automate the substitution is + +`bash` or `zsh`: ```sh vterm_cmd() { local vterm_elisp @@ -497,6 +499,17 @@ vterm_cmd() { vterm_printf "51;E$vterm_elisp" } ``` +`fish`: +```sh +function vterm_cmd --description 'Run an emacs command that\'s been defined in vterm-eval-cmds' + set -l vterm_elisp () + for arg in $argv + set -a vterm_elisp (printf '"%s" ' (string replace -a -r '([\\\\"])' '\\\\\\\\$1' $arg)) + end + vterm_printf '51;E'(string join '' $vterm_elisp) +end +``` + Now we can write shell functions to call the ones defined in `vterm-eval-cmds`. ```sh |
