We can scroll tmux output with
C-b [ by default, and it provides vim like key binding.
However, some bindings are different from my customized vim.
So I add some scripts and settings to open tmux output with Vim (or any other text editor).
Fortunately, tmux has a nice command
#!/bin/bash # $HOME/bin/vim-edit-tmux-output file=`mktemp`.sh tmux capture-pane -pS -32768 > $file tmux new-window -n:mywindow "vim '+ normal G $' $file"
chmod +x $HOME/bin/vim-edit-tmux-output
# $HOME/.tmux.conf setenv -g PATH "$HOME/bin:$PATH" set-option -g history-limit 20000 bind-key C-e run-shell "vim-edit-tmux-output"
C-b C-e and you can open your tmux output!
Another nice feature is that tmux automatically closes the new pane for Vim after quiting vim.