-
-
Save dlip/79300d6ccb7365d9954796ded8bf202a to your computer and use it in GitHub Desktop.
Helix exec: run command on current file with helix using zellij
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Run command on current file with helix using zellij | |
# Requires https://github.com/helix-editor/helix/pull/6985 | |
# eg. echo current filename | |
# :sh he echo | |
set -euo pipefail | |
# run command | |
zellij action write-chars ':' | |
# write shell command | |
zellij action write-chars "sh $@ " | |
# ctrl +r to select registry | |
zellij action write 18 | |
# paste from document path registry | |
zellij action write-chars '%' | |
# enter | |
zellij action write 13 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment