Skip to content

Instantly share code, notes, and snippets.

@brynedwards
Created October 9, 2017 15:42
Show Gist options
  • Save brynedwards/659ca7c1169ac1c7419591afd1c5f345 to your computer and use it in GitHub Desktop.
Save brynedwards/659ca7c1169ac1c7419591afd1c5f345 to your computer and use it in GitHub Desktop.
def tmux-send-command -docstring "Send command to the repl pane" -params 0..1 %{
nop %sh{
tmux set-buffer -b kak_selection "$1"
kak_orig_window=$(tmux display-message -p '#I')
kak_orig_pane=$(tmux display-message -p '#P')
tmux select-window -t:$(tmux show-buffer -b kak_repl_window)
tmux select-pane -t:.$(tmux show-buffer -b kak_repl_pane)
tmux paste-buffer -b kak_selection
tmux send-keys Enter
tmux select-window -t:${kak_orig_window}
tmux select-pane -t:.${kak_orig_pane}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment