Ok so I'm not familiar with tmux at all, but I gather from the vim-tidal readme that one can start a tmux session with tmux new-session -s tidal ghci -ghci-script Tidal.ghci
but I have no clue how to send commands there... Should the editor also be started in the tmux session? I tried looking at the vim-tidal source code but I couldn't find anything useful in just a glance.
Update: So, one can run tmux send-keys -l
(-l
for literal characters, i.e., to not use named characters like "Enter") from anywhere, not just within the / a tmux session. But that command doesn't take pipe input, so you have to use xargs -0 tmux send-keys
in helix (-0
because otherwise xargs thinks the arguments it gets are separated by whitespace). I haven't tried this with tidal yet but it seems like it should work.
Update 2: with the following in tidal_send.sh
:
tmux send-keys ":{" "Enter"
xargs -0 tmux send-keys -l < /dev/stdin
tmux send-keys "Enter" ":}" "Enter"
you can pipe a selection to tidal with alt+|
and entering ./tidal_send.sh
as the command to pipe to. I'm sure there's a more compact way than the three lines above, but this works.
Update 3: In helix's config.toml:
[keys.normal]
"A-ret" = ":pipe-to ./tidal-send.sh"
(S-ret
and C-ret
are used by my terminal for other things, so I'm using alt...)
Update 4: To highlight .tidal
files with Haskell syntax highlighting, add the following to .config/helix/languages.toml
(I'm not sure all of these settings are necessary tbh, but this worked for me):
[[language]]
name = "tidal"
scope = "source.tidal"
roots = []
injection-regex = "tidal"
file-types = ["tidal"]
comment-token = "--"
indent = { tab-width = 2, unit = " " }
grammar = "haskell"
and then link the Haskell highlight file into the user runtime directory:
ln -s /usr/lib/helix/runtime/queries/haskell/highlights.scm ~/.config/helix/runtime/queries/tidal