Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@zhaocai
Created September 8, 2012 16:36
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhaocai/3676890 to your computer and use it in GitHub Desktop.
Save zhaocai/3676890 to your computer and use it in GitHub Desktop.
vim` quick eval current selected lines with vimshell interactive shell
command! -range Ieval :<line1>,<line2>call EvalScriptRegion()
vnoremap <silent> <CR> :Ieval<CR>
function! EvalScriptRegion() range
if has_key(g:vimshell_interactive_interpreter_commands, &ft)
exec a:firstline.','a:lastline.'VimShellSendString'
else
exec a:firstline.','a:lastline.'QuickRun'
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment