From 54cf2d94119c06b153063c8ee8946abb1ed69261 Mon Sep 17 00:00:00 2001 From: Roman Gonzalez Date: Fri, 3 Jun 2011 18:22:38 -0700 Subject: [PATCH] Adding support for Scala --- plugin/repl.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin/repl.vim b/plugin/repl.vim index 0c11349..3e9de7c 100644 --- a/plugin/repl.vim +++ b/plugin/repl.vim @@ -7,6 +7,8 @@ function! Repl() call ReplErlang() elseif &filetype == 'python' call ReplPython() + elseif &filetype == 'scala' + call ReplScala() endif endfunction @@ -59,6 +61,15 @@ function! ReplPython() let b:interactive.is_close_immediately = 1 call vimshell#interactive#send_string("from " . l:currentFile . " import *\n") endfunction + +function! ReplScala() + let l:currentFile = expand('%') + let l:args = 'scala -i ' . l:currentFile + call vimshell#execute_internal_command( + \ 'iexe', vimproc#parser#split_args(l:args), { 'stdin' : '', 'stdout' : '', 'stderr' : '' }, + \ { 'is_interactive' : 0, 'is_single_command' : 1 }) + let b:interactive.is_close_immediately = 1 +endfunction command! -nargs=0 Repl call Repl() nnoremap i :Repl