pairing with tmux and vim for devops days austin 2015
TRANSCRIPT
Pairing with tmux and vim
Realtime Toolsfor Remote Teams
Scott Baldwin
Chief Happiness Officer, WellMatch@scottsbaldwin
We are NOT in the same room
• Instant Messaging: HipChat
• A/V: Skype
• Workstation: EC2
• ChatOps: lita
• Text Editor: vim
• Realtime Enabler: tmux
Pair Programming
• distribute knowledge
• build quality up front
• mentoring
• can be taxing
• can be awkward
• shows your vulnerabilities
• requires humility
Positivity + Eye Contact =Biobehavioral synchronyWhen positive emotions are sharedand two people make eye contact,they move to the same hidden beatand start to act as one.
tmux
• create and attach to terminal sessions
• sessions can keep running in the background
• don't worry about "Write failed: Broken pipe"
carve up your terminal
into panes
~/.tmux.conf
# setw: set-window-option# -g: sets the global sessionsetw -g mode-keys vibind | split-window -hbind - split-window -v
# vim direction keys for pane switchingbind h select-pane -Lbind j select-pane -Dbind k select-pane -Ubind l select-pane -R
# maximize a paneunbind Up; bind Up resize-pane -Z;unbind Down; bind Zoom resize-pane -Z;
vim
• terminal-based text editor
• sure, you could use emacs
• extensible with plugins to provide more power
• try to learn a new editor trick each week
carve up your vim
into splits
I use it for devopsdays.org
Synchronized panes in tmux
:setw synchronized-panes on
tmuxinator
• quickly start up all your tmux panes
• launch commands within each panewindows: - editor: layout: main-vertical panes: - vim - guard - server: bundle exec rails s - logs: tail -f log/development.log
How we code remotely
• provision pairing instance
• checkout a feature branch
• pair programming
• acceptance of feature
• merge to master
• tear down pairing instance
I <3 chatops
"data" is our ChatOps botbot pair mebot pair add scottsbaldwin to quivering-cactus-4911bot pair add <another user> to quivering-cactus-4911bot pair stop quivering-cactus-4911bot pair start quivering-cactus-4911ssh scottsbaldwin@quivering-cactus-4911sudo su devusertmux new -s my_session
Driver/navigator
• set a timer, change roles
• person 1: dictates
• person 2: types
Ping pong
• person 1: write failing test
• person 2: make test pass
The Gondola
• I am a gondolier
• team members take a ride
• tmux provides a gondola
• riders enjoy the views
Lessons I have Learned
• pairing is hard
• personal growth:
• patience
• listening
• communicating
• my way isn't always right
• it's kind of like marriage!
Happy Pairing!@scottsbaldwin
Chief Happiness Officer, WellMatch