Redirect Ex command output to file in Vim
:redir > /tmp/file | ls | redir END
" redir     => begin redirect message to file/register etc.
" |         => link multiple Ex commands in same line.
" ls        => Ex command -> list all buffers
" redir END => end redirect message