Split filetype files

This commit is contained in:
aiya000
2015-12-20 19:53:58 +09:00
parent 5e074a331c
commit 5748db0ed0
5 changed files with 121 additions and 146 deletions

20
autoload/repl/ruby.vim Normal file
View File

@@ -0,0 +1,20 @@
scriptencoding utf-8
function! repl#ruby#open_repl() abort
" Setting up the obj file for the current file
if &modified
let l:module_file = tempname() . '.rb'
call writefile(getline(1, expand('$')), l:module_file)
else
let l:module_file = expand('%:p')
endif
let l:repl = get(g:, 'repl_filetype_repl.ruby.repl', g:repl#default_filetype_repl.ruby['repl'])
let l:opt = get(g:, 'repl_filetype_repl.ruby.opt', g:repl#default_filetype_repl.ruby['opt'])
if !executable(l:repl)
call repl#echo_error(printf("You don't have repl: '%s'", l:repl))
return
endif
let l:args = printf('%s %s %s', l:repl, l:opt, l:module_file)
execute ':VimShellInteractive' l:args
endfunction