Skip to content

Instantly share code, notes, and snippets.

@lululau
Created December 25, 2014 14:50
Show Gist options
  • Select an option

  • Save lululau/7e96dac4572b63236bf5 to your computer and use it in GitHub Desktop.

Select an option

Save lululau/7e96dac4572b63236bf5 to your computer and use it in GitHub Desktop.
Let shells in each pane of each tab of each window of iTerm2 to start in a pre-configured cwd and execute commands
w0t0p2:
dir: "~"
commands:
- pry
w0t1p0:
dir: "~/a/"
w0t1p1:
dir: "~/a/"
w0t1p2:
dir: "~/b/"
w0t1p3:
dir: "~/c/"
w0t2p0:
dir: "~/c"
w0t2p1:
dir: "~/d"
w0t2p4:
dir: "~/tmp"
w0t5p2:
dir: "~/cascode/clojure/"
if [ -n "$ITERM_SESSION_ID" ]
then
eval "$(icrt.rb "$ITERM_SESSION_ID")"
fi
#!/usr/bin/env ruby
require 'yaml'
if (config = YAML.load(IO.read(File.expand_path("~/.icrt.yaml")))[ARGV.first]) != nil
puts (["cd #{config["dir"]}"] + (config["commands"] || [])) * "\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment