]> git.wincent.com - docvim.git/commitdiff
Add .tmux file
authorGreg Hurrell <greg@hurrell.net>
Thu, 24 Mar 2016 16:02:28 +0000 (09:02 -0700)
committerGreg Hurrell <greg@hurrell.net>
Thu, 24 Mar 2016 16:03:16 +0000 (09:03 -0700)
Which I run conveniently using this dotfile magic:

https://github.com/wincent/wincent/blob/3be6a3b840dec48ab/roles/dotfiles/files/.zsh/functions#L41-L80

.tmux [new file with mode: 0755]

diff --git a/.tmux b/.tmux
new file mode 100755 (executable)
index 0000000..63df1af
--- /dev/null
+++ b/.tmux
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+set -e
+
+if tmux has-session -t docvim 2> /dev/null; then
+  tmux attach -t docvim
+  exit
+fi
+
+tmux new-session -d -s docvim -n vim
+
+# 1. Main window: vim.
+tmux send-keys -t docvim:vim "vim -c CommandT" Enter
+
+# 2. REPL.
+tmux new-window -t docvim -n repl
+tmux send-keys -t docvim:repl "stack repl" Enter
+
+# 3. General shell use.
+tmux new-window -t docvim
+
+tmux attach -t docvim:vim