commit
4910aa7d7b
@ -46,6 +46,7 @@ Run `:Repl` without saving the code on a file.
|
|||||||
* JavaScript
|
* JavaScript
|
||||||
* Clojure
|
* Clojure
|
||||||
* Idris
|
* Idris
|
||||||
|
* Racket
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ function! repl#run_repl() abort
|
|||||||
call repl#clojure#open_repl()
|
call repl#clojure#open_repl()
|
||||||
elseif &filetype ==# 'idris'
|
elseif &filetype ==# 'idris'
|
||||||
call repl#idris#open_repl()
|
call repl#idris#open_repl()
|
||||||
|
elseif &filetype ==# 'scheme'
|
||||||
|
call repl#scheme#open_repl()
|
||||||
else
|
else
|
||||||
call repl#echo_error("Sorry, repl.vim didn't support this filetype")
|
call repl#echo_error("Sorry, repl.vim didn't support this filetype")
|
||||||
endif
|
endif
|
||||||
|
21
autoload/repl/scheme.vim
Normal file
21
autoload/repl/scheme.vim
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
scriptencoding utf-8
|
||||||
|
|
||||||
|
function! repl#scheme#open_repl() abort
|
||||||
|
if &modified
|
||||||
|
let l:module_file = tempname() . '.rkt'
|
||||||
|
call writefile(getline(1, expand('$')), l:module_file)
|
||||||
|
else
|
||||||
|
let l:module_file = expand('%:p')
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:repl = repl#get_filetype_repl('scheme')
|
||||||
|
let l:exec_name = split(l:repl['repl'], ' ')[0]
|
||||||
|
if !executable(l:exec_name)
|
||||||
|
call repl#echo_error(printf("You don't have repl: '%s'", l:exec_name))
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let l:args = printf('%s -f %s %s', l:repl['repl'], l:module_file, l:repl['opt'])
|
||||||
|
let l:vimshell_interactive = ':VimShellInteractive' . printf("--split='%s'", g:repl_split_command)
|
||||||
|
execute l:vimshell_interactive l:args
|
||||||
|
endfunction
|
||||||
|
|
@ -36,6 +36,10 @@ let g:repl#default_filetype_repl = {
|
|||||||
\ 'idris' : {
|
\ 'idris' : {
|
||||||
\ 'repl' : 'idris',
|
\ 'repl' : 'idris',
|
||||||
\ 'opt' : ''
|
\ 'opt' : ''
|
||||||
|
\ },
|
||||||
|
\ 'scheme' : {
|
||||||
|
\ 'repl' : 'racket',
|
||||||
|
\ 'opt' : '-i'
|
||||||
\ }
|
\ }
|
||||||
\}
|
\}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user