Skip to content

Instantly share code, notes, and snippets.

@dlip
Last active March 15, 2024 12:17
Show Gist options
  • Save dlip/79300d6ccb7365d9954796ded8bf202a to your computer and use it in GitHub Desktop.
Save dlip/79300d6ccb7365d9954796ded8bf202a to your computer and use it in GitHub Desktop.
Helix exec: run command on current file with helix using zellij
#!/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