Skip to content

Instantly share code, notes, and snippets.

@AndrewRadev
Created July 24, 2011 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewRadev/1102968 to your computer and use it in GitHub Desktop.
Save AndrewRadev/1102968 to your computer and use it in GitHub Desktop.
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