Skip to content

Instantly share code, notes, and snippets.

@Shougo
Forked from tyru/.vimrc
Created April 17, 2010 00:09
Show Gist options
  • Save Shougo/369112 to your computer and use it in GitHub Desktop.
Save Shougo/369112 to your computer and use it in GitHub Desktop.
" Capture {{{
command!
\ -nargs=+ -bang
\ -complete=command
\ Capture
\ call s:cmd_capture([<f-args>], <bang>0)
function! C(cmd)
redir => result
silent execute a:cmd
redir END
return result
endfunction
function! s:cmd_capture(args, banged) "{{{
new
silent put =C(join(a:args))
1,2delete _
endfunction "}}}
" }}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment