Skip to content

Instantly share code, notes, and snippets.

@LNA
Last active January 28, 2016 18:12
Show Gist options
  • Save LNA/593819287b73e7bb233e to your computer and use it in GitHub Desktop.
Save LNA/593819287b73e7bb233e to your computer and use it in GitHub Desktop.
Tmux
get to next tab: gt or GT
ember test --server --launch='Google Chrome'
setw -g mode-keys vi
set -g default-terminal "screen-256color"
unbind C-b
set -g prefix C-z
bind z send-keys C-z
bind C-z last-window
bind | split-window -h
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind ` select-window -t 0
# Search for previous error
bind-key e copy-mode \; send-keys "?Error" C-m
set -sg escape-time 0
# scrollback buffer size increase
set -g history-limit 100000
# Use up and down arrows for temporary "maximize"
unbind Up; bind Up resize-pane -Z; unbind Down; bind Down resize-pane -Z
# Copy/paste interop
bind C-c run "tmux show-buffer | reattach-to-user-namespace pbcopy"
bind C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
bind -t vi-copy y copy-pipe 'reattach-to-user-namespace pbcopy'
bind -t vi-copy v begin-selection
bind -t vi-copy V rectangle-toggle
# Allows scrolling and selecting in copy-mode
set -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
# Better project name in status bar
set -g status-left-length 18
set -g status-left '#[fg=colour235,bg=colour76,bold] #S '
if-shell '[[ -e ~/.tmux.conf.local ]]' 'source-file ~/.tmux.conf.local'

Tmux is great! Here is how I'll be using it.

leader == control z or caps lock z.

  1. Start tmux simply by typing tmux into the shell.
  2. Split the current screen in half leader shift | . Now, there should be 2 screens.
  3. The left is your shell, the right is for vim. Drag the bar from the center to the left, so vim will have most of the real estate.
  4. We neen another window. leader c will get you there.
  5. Split this screen too. Use leader shift | followed by leader c.
  6. Run the test server on the left ember test --server and server on the right ember s
  7. Navigate using leader n and leader h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment