Dump to a file and automatically open the file in vim
This is sweet:
bind-key v 'capture-pane' \; \
capture-pane -JS - \; \
save-buffer /tmp/tmux \; \
delete-buffer \; \
send-keys Escape 'ddivim /tmp/tmux' Enter
I'm also using -J because you obviously don't want newlines to be arbitrarily inserted on every arbitrary terminal wrap!
It supposes that your shell is in vi mode, so that:
- Escape goes into normal mode
ddclears any existing commandigoes into insert mode- then we run
vim /tmp/tmux
Tested in tmux 3.0.