4 years ago
Some vim commands output quite a lot of text and it would be nice to get the output in a more readable format. This command lets you do that. Simply prefix any command-line invocation with
:Bufferize and you'll get the standard output in a Vim buffer.
Try these examples out:
:Bufferize let g:
command! -nargs=* -complete=command Bufferize call s:Bufferize(<q-args>) function! s:Bufferize(cmd) let cmd = a:cmd redir => output silent exe cmd redir END new setlocal nonumber call setline(1, split(output, "\n")) set nomodified endfunction