Table of Contents
somewhere in .vimrc
call minpac#init()
" ...
" more plugins
" ...
call minpac#add('habamax/vim-sendtoterm')
Then :call minpac#update()
to install it.
-
open terminal
:term
-
type in any other buffer:
dir /w
-
<leader>tt
to send current line -
You should see directory list printed in a terminal
-
open terminal
:term
-
run interactive elixir there
iex
-
in the other buffer type
(1..100) |> Enum.sum()
-
<leader>tt
to send current line toiex
-
You should see something like:
Interactive Elixir (1.8.1) - press Ctrl+C to exit (type h() ENTER for help) iex(1)> (1..100) |> Enum.sum() 5050 iex(2)>
You can also use other text objects:
defmodule MyMod do
def hello(world) do
IO.puts(world)
end
end
MyMod.hello("Hey!")
Press <leader>tip
to send current paragraph to iex
:
iex(2)> defmodule MyMod do
def hello(world) do
...(2)> IO.puts(world)
...(2)> end
end
...(2)> MyMod.hello("Hey!")
...(2)> {:module, MyMod,
<<70, 79, 82, 49, 0, 0, 4, 88, 66, 69, 65, 77, 65, 116, 85, 56, 0, 0, 0, 140,
0, 0, 0, 15, 12, 69, 108, 105, 120, 105, 114, 46, 77, 121, 77, 111, 100, 8,
95, 95, 105, 110, 102, 111, 95, 95, 7, ...>>, {:hello, 1}}
iex(3)> Hey!
:ok
iex(4)>