# HG changeset patch # User Steve Losh # Date 1440671245 0 # Node ID 75191cd2829ebb49dc207094d20575d1dea13f43 # Parent 4bd19acc976f452e86ca9bcb66596f1920eb6d77 Just keep neorepl in here for now, whatever diff -r 4bd19acc976f -r 75191cd2829e vim/bundle/neorepl/README.markdown --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/bundle/neorepl/README.markdown Thu Aug 27 10:27:25 2015 +0000 @@ -0,0 +1,8 @@ + __ + ___ ___ ___ _______ ___ / / + / _ \/ -_) _ \/ __/ -_) _ \/ / + /_//_/\__/\___/_/ \__/ .__/_/ + /_/ + +A dead-simple way to send text from a neovim buffer to a running neovim +terminal. That's it, nothing else. diff -r 4bd19acc976f -r 75191cd2829e vim/bundle/neorepl/plugin/neorepl.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/bundle/neorepl/plugin/neorepl.vim Thu Aug 27 10:27:25 2015 +0000 @@ -0,0 +1,47 @@ +" ============================================================================ +" File: neorepl.vim +" Description: Send text from neovim buffers to neovim terminals. +" Maintainer: Steve Losh +" License: MIT/X11 +" ============================================================================ + +" Init {{{ + +if !exists('g:neorepl_debug') && (exists('loaded_neorepl') || &cp) + finish +endif + +let loaded_neorepl = 1 +let g:neorepl_jobid = 0 + +"}}} +" Functions {{{ + +function! s:NeoRepl(command) " {{{ + vnew + let result = termopen(a:command) + + let g:neorepl_jobid = result +endfunction " }}} + +function! NeoReplSendRaw(payload) " {{{ + for line in (split(a:payload, '\n')) + call jobsend(g:neorepl_jobid, line . "\n") + sleep 2m " please kill me + endfor +endfunction " }}} + +function! NeoReplSendSelection() " {{{ + let old_z = @z + normal! gv"zy + + call NeoReplSendRaw(@z . "\n") + let @z = old_z +endfunction " }}} + +" }}} +" Command {{{ + +command! -range=0 -complete=shellcmd -nargs=1 NeoRepl call s:NeoRepl() + +" }}}