Adding support for Scala
This commit is contained in:
parent
97fd93c42c
commit
54cf2d9411
@ -7,6 +7,8 @@ function! Repl()
|
|||||||
call ReplErlang()
|
call ReplErlang()
|
||||||
elseif &filetype == 'python'
|
elseif &filetype == 'python'
|
||||||
call ReplPython()
|
call ReplPython()
|
||||||
|
elseif &filetype == 'scala'
|
||||||
|
call ReplScala()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -59,6 +61,15 @@ function! ReplPython()
|
|||||||
let b:interactive.is_close_immediately = 1
|
let b:interactive.is_close_immediately = 1
|
||||||
call vimshell#interactive#send_string("from " . l:currentFile . " import *\n")
|
call vimshell#interactive#send_string("from " . l:currentFile . " import *\n")
|
||||||
endfunction
|
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()
|
command! -nargs=0 Repl call Repl()
|
||||||
nnoremap <Space>i :<C-u>Repl<Cr>
|
nnoremap <Space>i :<C-u>Repl<Cr>
|
||||||
|
Reference in New Issue
Block a user