Created
July 24, 2011 19:18
-
-
Save AndrewRadev/1102968 to your computer and use it in GitHub Desktop.
Load a vim command's output into a buffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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