Skip to content

Instantly share code, notes, and snippets.

@vsbuffalo
Created August 18, 2015 16:10
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 vsbuffalo/12b19045028377920a49 to your computer and use it in GitHub Desktop.
Save vsbuffalo/12b19045028377920a49 to your computer and use it in GitHub Desktop.
augroup Terminal
au!
au TermOpen * let g:last_terminal_job_id = b:terminal_job_id
augroup END
function! REPLSend(lines)
call jobsend(g:last_terminal_job_id, add(a:lines, ''))
endfunction
command! REPLSendLine call REPLSend([getline('.')])
command! REPLSendLines call REPLSend(getline("'<", "'>")) " this doesn't work
nnoremap <c-l> :REPLSendLine<cr>
inoremap <c-l> :REPLSendLine<cr>
vnoremap <c-l> :REPLSendLines<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment