My webzone

A place for John Bintz to ramble.

That sense of tmux cameraderie

I’ve switched to tmux and wanted to simplify my life as best as I can when using it, so I tried a few tmux gems to manage configs and decided on teamocil. However, like anything involving a terminal multiplexer, it needs massaging (Teamocil may cause numbness of the extremities.):

# ~/.bash_profile

tmc() {
  tmux has -t $1 && tmux attach -t $1 || tmux new -s $1 "teamocil $1"
}

function _tmc() {
  local IFS=$'\n'
  local cur="$2"
  COMPREPLY=($(compgen -W "$(find ~/.teamocil -type f | sed 's#^.*/\(.*\)\.yml$#\1#' )" -- "${cur}"))
}

complete -F _tmc tmc
# ~/.tmux.conf

set -g base-index 0

Then, don’t use the session key in your configs:

# ~/.teamocil/johnbintz-gh.yml

windows:
  - name: vim
    root: ~/Projects/johnbintz-gh
    splits:
      - cmd: vim
        height: 90
      - cmd: be rake preview
        height: 10

And finally, tmc johnbintz-gh will start or rejoin an exisiting Teamocil-configured session.

I could’ve sworn my terminal management just got easier. Or not. I think hallucination is one of the side effects of Teamocil. (It isn’t.)