This action will delete this post on this instance and on all federated instances, and it cannot be undone. Are you certain you want to delete this post?
This action will delete this post on this instance and on all federated instances, and it cannot be undone. Are you certain you want to delete this post?
This action will block this actor and hide all of their past and future posts. Are you certain you want to block this actor?
This action will block this object. Are you certain you want to block this object?
@adamhsparks well, it might have been a bit of cheating, but besides the lines of config:[keys.normal]
C-c = { C-c = ["goto_prev_paragraph", "collapse_selection", "goto_next_paragraph", ":pipe-to ~/.local/bin/send-to-tmux", "collapse_selection"], c = ["toggle_comments"] }
[keys.select]
C-c = { C-c = [":pipe-to ~/.local/bin/send-to-tmux"], c = ["toggle_comments"] }
There are actually two bash scripts involved as well:
~/.local/bin/send-to-tmux.sh#!/usr/bin/env bash
while IFS= read line; do
tmux send-keys -t "helix_term" "$line" "Enter"
done
~/.local/bin/helixterm.sh#!/usr/bin/env bash
# unset $TMUX variable to enforce spawn
export TMUX=""
# Grab command
if [[ -z "$1" ]]; then
CMD="$SHELL"
else
CMD="$1"
fi
# Create new tmux session
tmux -2 new-session -s "helix_term" -d "$CMD"
# Attach to tmux session
tmux -2 attach-session -t "helix_term"
I now can simply start my #rstats session with helixterm.sh R
in a split terminal next to my script opened in helix and send code to it (both in normal or select mode) with 2x Ctrl-C. Of course that also works on a remote R-session via ssh and whatnot.