Skip to content

Instantly share code, notes, and snippets.

@jphenow
Created February 9, 2016 18:04
Show Gist options
  • Save jphenow/69f918e8f0af238f192e to your computer and use it in GitHub Desktop.
Save jphenow/69f918e8f0af238f192e to your computer and use it in GitHub Desktop.
a tmux conf that works with new keybindings blah blah
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+
# act more like vim
unbind l
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R # -l does last
bind C-a last-window
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
setw -g mode-keys vi
unbind [
unbind p
bind C-y copy-mode
bind p paste-buffer
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-selection
bind -t vi-copy Escape cancel
# move x clipboard into tmux paste buffer
bind C-p run-shell "tmux set-buffer \"$(pbpaste)\"; tmux paste-buffer"
# # move tmux copy buffer into x clipboard
bind C-g run-shell "tmux show-buffer | pbcopy"
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
set-option -g default-command "reattach-to-user-namespace -l zsh"
# Options
set -g bell-action none
set -g set-titles on
set -g set-titles-string "tmux (#I:#W)"
set -g base-index 1
set-window-option -g pane-base-index 1
# soften status bar color from harsh green to light gray
set -g status-bg '#666667'
set -g status-fg '#aaaaaa'
# Set the current working directory based on the current pane's current
# # working directory (if set; if not, use the pane's starting directory)
# # when creating # new windows and splits.
bind-key c new-window -c '#{pane_current_path}'
bind-key '"' split-window -c '#{pane_current_path}'
bind-key % split-window -h -c '#{pane_current_path}'
bind-key S command-prompt "new-session -A -c '#{pane_current_path}' -s '%%'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment