From 24cc6c7633524b0690f62d1b48b73170e9e268d8 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Wed, 18 Jun 2014 09:42:45 -0700 Subject: [PATCH] Add tmux --- ansible/config.yml | 1 + tmux/.tmux.conf | 99 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 tmux/.tmux.conf diff --git a/ansible/config.yml b/ansible/config.yml index c7a24a4..d283596 100644 --- a/ansible/config.yml +++ b/ansible/config.yml @@ -22,6 +22,7 @@ vars: stow_packages: - git + - tmux tasks: - name: clone dotfiles git: repo=https://github.com/kejadlen/dotfiles.git dest=~/.dotfiles diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf new file mode 100644 index 0000000..48d0c79 --- /dev/null +++ b/tmux/.tmux.conf @@ -0,0 +1,99 @@ +set-option -g default-terminal "screen-256color" + +## messages +set-option -g display-time 3000 + +## scrollback buffer +set-option -g history-limit 5000 + +## unicode +set-option -g status-utf8 on +set-window-option -g utf8 on + +## status bar +# set-option -g status-bg black +# set-option -g status-fg white +# set-option -g status-right "" +# set-option -g status-left "#S" +# set-window-option -g window-status-current-attr reverse +# set-window-option -g window-status-current-bg white +# set-window-option -g window-status-current-bg black + +## window notifications +set-option -g visual-activity on +set-option -g visual-content on +set-window-option -g monitor-activity off + +## title +set-option -g set-titles on +set-option -g set-titles-string "[#S] #I:#W" +set-option -g automatic-rename on + +## mouse +set-window-option -g mode-mouse off +# set-window-option -g mode-mouse on +# set-option -g mouse-select-pane on +# set-option -g mouse-resize-pane on +# set-option -g mouse-select-window on + +# copy and paste +bind -t vi-copy 'v' begin-selection +bind -t vi-copy 'y' copy-selection + +## etc +set-window-option -g mode-keys vi +set-option -sg escape-time 1 # increase vim responsiveness +set-option -g renumber-windows on +# set-option -g status-justify centre +set-option -g base-index 1 + +## screen bindings + +# use C-a as the prefix (a la screen) +unbind C-b +set-option -g prefix C-a + +bind a send-prefix + +bind c new-window -c '#{pane_current_path}' +bind C-c new-window -c '#{pane_current_path}' + +bind d detach +bind C-d detach + +bind n next-window +bind C-n next-window + +bind p previous-window +bind C-p previous-window + +bind C-a last-window + +bind v split-window -h -c '#{pane_current_path}' +bind s split-window -v -c '#{pane_current_path}' + +# bind h select-pane -L +# bind j select-pane -D +# bind k select-pane -U +# bind l select-pane -R + +# Smart pane switching with awareness of vim splits +bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-h) || tmux select-pane -L" +bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-j) || tmux select-pane -D" +bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-k) || tmux select-pane -U" +bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-l) || tmux select-pane -R" +bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l" +bind C-l send-keys 'C-l' + +bind -r < resize-pane -L 3 +bind -r > resize-pane -R 3 +bind -r - resize-pane -D 3 +bind -r + resize-pane -U 3 +bind -r = resize-pane -U 3 + +unbind r +bind r source-file ~/.tmux.conf \; display 'Reloaded tmux.conf' + +# TODO Figure out why this is order dependent +source-file ~/.tmux.conf.local +source-file ~/Dropbox/conf_dir/src/powerline/powerline/bindings/tmux/powerline.conf