Last active
July 22, 2019 20:20
-
-
Save izelnakri/6d1078fe86f0bbfe0071cf7f95a9d236 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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