Skip to content

Instantly share code, notes, and snippets.

@izelnakri
Last active July 22, 2019 20:20
Show Gist options
  • Select an option

  • Save izelnakri/6d1078fe86f0bbfe0071cf7f95a9d236 to your computer and use it in GitHub Desktop.

Select an option

Save izelnakri/6d1078fe86f0bbfe0071cf7f95a9d236 to your computer and use it in GitHub Desktop.
defmodule Izel do
def nvim do
System.cmd("tmux", ["new-window", "-n", "sketchpad", "nvim", "/Users/izelnakri/sketchpad.exs"])
trap_nvim_window_exit()
end
def trap_nvim_window_exit do
case System.cmd("tmux", ["has-session", "-t", "main:sketchpad"], stderr_to_stdout: true) do
{_, 0} ->
Process.sleep(100)
trap_nvim_window_exit()
_ ->
Code.eval_file("/Users/izelnakri/sketchpad.exs")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment