From 60e7659efea8a348e5c2c912ac472637a6fae5d7 Mon Sep 17 00:00:00 2001 From: aiya000 Date: Tue, 22 Dec 2015 23:36:09 +0900 Subject: [PATCH] Implement g:repl_split_command --- autoload/repl/erlang.vim | 5 +++-- autoload/repl/haskell.vim | 5 +++-- autoload/repl/python.vim | 5 +++-- autoload/repl/ruby.vim | 5 +++-- plugin/repl.vim | 5 ++++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/autoload/repl/erlang.vim b/autoload/repl/erlang.vim index a205e98..ec4412f 100644 --- a/autoload/repl/erlang.vim +++ b/autoload/repl/erlang.vim @@ -45,9 +45,10 @@ function! repl#erlang#open_repl() abort 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) + let l:args = printf('%s %s %s', l:repl, l:opt, l:module_file) + let l:vimshell_interactive = ':VimShellInteractive' . printf("--split='%s'", g:repl_split_command) - execute ':VimShellInteractive' l:args + execute l:vimshell_interactive l:args call vimshell#interactive#send(printf('c(%s).', fnamemodify(l:module_file, ':t:r'))) execute 'cd' l:pwd endfunction diff --git a/autoload/repl/haskell.vim b/autoload/repl/haskell.vim index 4906fdd..011919a 100644 --- a/autoload/repl/haskell.vim +++ b/autoload/repl/haskell.vim @@ -16,6 +16,7 @@ function! repl#haskell#open_repl() abort 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 + let l:args = printf('%s %s %s', l:repl, l:opt, l:module_file) + let l:vimshell_interactive = ':VimShellInteractive' . printf("--split='%s'", g:repl_split_command) + execute l:vimshell_interactive l:args endfunction diff --git a/autoload/repl/python.vim b/autoload/repl/python.vim index cce0861..7f1a52f 100644 --- a/autoload/repl/python.vim +++ b/autoload/repl/python.vim @@ -16,6 +16,7 @@ function! repl#python#open_repl() abort 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 + let l:args = printf('%s %s %s', l:repl, l:opt, l:module_file) + let l:vimshell_interactive = ':VimShellInteractive' . printf("--split='%s'", g:repl_split_command) + execute l:vimshell_interactive l:args endfunction diff --git a/autoload/repl/ruby.vim b/autoload/repl/ruby.vim index 2af5ebd..f21eff8 100644 --- a/autoload/repl/ruby.vim +++ b/autoload/repl/ruby.vim @@ -15,6 +15,7 @@ function! repl#ruby#open_repl() abort 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 + let l:args = printf('%s %s %s', l:repl, l:opt, l:module_file) + let l:vimshell_interactive = ':VimShellInteractive' . printf("--split='%s'", g:repl_split_command) + execute l:vimshell_interactive l:args endfunction diff --git a/plugin/repl.vim b/plugin/repl.vim index f9971a8..6d6b780 100644 --- a/plugin/repl.vim +++ b/plugin/repl.vim @@ -5,7 +5,7 @@ endif let g:loaded_repl_vim = 1 let s:save_cpo = &cpo set cpo&vim -"#--- --- ---#" +"-------------------" let g:repl#default_filetype_repl = { \ 'haskell' : { @@ -26,6 +26,9 @@ let g:repl#default_filetype_repl = { \ } \} +" 'split' or 'vertical split' +let g:repl_split_command = get(g:, 'repl_split_command', 'split') + command! -bar -nargs=0 Repl call repl#run_repl() nnoremap (repl-run) :call repl#run_repl()