then contents
This commit is contained in:
parent
1719b3ba7a
commit
bc382fe305
@ -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 `<space>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 `<space>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.
|
||||
|
||||
|
@ -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 <Space>i :<C-u>QuickInteractive<Cr>
|
||||
command! -nargs=0 Repl call Repl()
|
||||
nnoremap <Space>i :<C-u>Repl<Cr>
|
||||
|
Reference in New Issue
Block a user