Skip to content

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
setlocal nonumber
call append(0, split(output, "\n"))
set nomodified
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.