Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Load a vim command's output into a buffer
" For example:
"
" Bufferize digraphs
" Bufferize ls
"
command! -nargs=* -complete=command Bufferize call s:Bufferize(<f-args>)
function! s:Bufferize(...)
let cmd = join(a:000, ' ')
redir => output
silent exe cmd
redir END
new
setlocal nonumber
call append(0, split(output, "\n"))
set nomodified
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment