diff --git a/README.md b/README.md index 08043df..be3769d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# quickinteractive.vim +# repl.vim Open the interactive environment with the code you are writing. @@ -14,7 +14,7 @@ You are writing the following code in an unnamed buffer. Now you want to try running the code in an interactive environment. Usually you are supposed to (1) save the code on somewhere, (2) open a terminal, (3) run `irb -r {the-file}`. -If you already installed quickinteractive.vim, you just have to run `:QuickInteractive` or to type `i`. It opens a buffer that is the environment you wanted. +If you already installed quickinteractive.vim, you just have to run `:Repl` or to type `i`. It opens a buffer that is the environment you wanted. irb> @@ -31,13 +31,13 @@ You can do test1 = TestCase (assertEqual "for (foo 3)," (1,2) (foo 3)) tests = TestList [TestLabel "test1" test1] -Run `:QuickInteractive` without saving the code on a file. +Run `:Repl` without saving the code on a file. ghci> runTestTT tests ## Installation - $ jolt install quickinteractive + $ jolt install repl.vim will be available soon. diff --git a/plugin/repl.vim b/plugin/repl.vim index 7560850..85aa4f6 100644 --- a/plugin/repl.vim +++ b/plugin/repl.vim @@ -1,12 +1,12 @@ -function! QuickInteractive() +function! Repl() if &filetype == 'ruby' - call QuickInteractiveRuby() + call ReplRuby() elseif &filetype == 'haskell' - call QuickInteractiveHaskell() + call ReplHaskell() endif endfunction -function! QuickInteractiveRuby() +function! ReplRuby() let l:tmpfile = tempname() . '.rb' call writefile(getline(1, expand('$')), l:tmpfile, 'b') let l:args = 'irb --simple-prompt -r ' . l:tmpfile @@ -16,7 +16,7 @@ function! QuickInteractiveRuby() let b:interactive.close_immediately = 1 endfunction -function! QuickInteractiveHaskell() +function! ReplHaskell() let l:tmpfile = tempname() . '.hs' let l:tmpobj = tempname() . '.o' call writefile(getline(1, expand('$')), l:tmpfile, 'b') @@ -29,5 +29,5 @@ function! QuickInteractiveHaskell() endfunction -command! -nargs=0 QuickInteractive call QuickInteractive() -nnoremap i :QuickInteractive +command! -nargs=0 Repl call Repl() +nnoremap i :Repl