From 273db6a5957b3ee0fe5aa2c10a24fd97db19c388 Mon Sep 17 00:00:00 2001 From: Yan Pritzker Date: Sun, 11 Nov 2012 20:15:43 -0600 Subject: [PATCH] Added tmux support [Fix #190] --- README.md | 3 +-- Rakefile | 1 + tmux/tmux.conf | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 tmux/tmux.conf diff --git a/README.md b/README.md index 97cb073..5365369 100644 --- a/README.md +++ b/README.md @@ -80,10 +80,9 @@ We automatically install a few useful packages including ack, ctags, git, and hu You can install macvim from brew as well, or download it from their website. ```bash -brew install ack ctags git hub macvim +brew install ack ctags git hub macvim tmux reattach-to-user-namespace ``` - ### Github Issues: [ghi gem](https://github.com/stephencelis/ghi) We include the `ghi` command. Try `ghi list` and have fun managing issues from command line! diff --git a/Rakefile b/Rakefile index 89fdb69..c09e135 100644 --- a/Rakefile +++ b/Rakefile @@ -16,6 +16,7 @@ task :install => [:submodule_init, :submodules] do file_operation(Dir.glob('irb/*')) if want_to_install?('irb/pry configs (more colorful)') file_operation(Dir.glob('ruby/*')) if want_to_install?('rubygems config (faster/no docs)') file_operation(Dir.glob('ctags/*')) if want_to_install?('ctags config (better js/ruby support)') + file_operation(Dir.glob('tmux/*')) if want_to_install?('tmux config') file_operation(Dir.glob('vimify/*')) if want_to_install?('vimification of command line tools') file_operation(Dir.glob('{vim,vimrc}')) if want_to_install?('vim configuration (highly recommended)') diff --git a/tmux/tmux.conf b/tmux/tmux.conf new file mode 100644 index 0000000..82d5d98 --- /dev/null +++ b/tmux/tmux.conf @@ -0,0 +1,73 @@ +# Ring the bell if any background window rang a bell +set -g bell-action any + +# Default termtype. If the rcfile sets $TERM, that overrides this value. +set -g default-terminal screen-256color +# set -g default-terminal "screen-256color" +# +set-option -g default-command "reattach-to-user-namespace -l $SHELL -l" + +# Keep your finger on ctrl, or don't +bind-key ^D detach-client + +# Create splits and vertical splits +bind-key v split-window -h +bind-key ^V split-window -h +bind-key s split-window +bind-key ^S split-window + +# Pane resize in all four directions using vi bindings. +# Can use these raw but I map them to shift-ctrl- in iTerm. +bind-key J resize-pane -D +bind-key K resize-pane -U +bind-key H resize-pane -L +bind-key L resize-pane -R + +# Use vi keybindings for tmux commandline input. +# Note that to get command mode you need to hit ESC twice... +set -g status-keys vi + +# Use vi keybindings in copy and choice modes +setw -g mode-keys vi +# +# easily toggle synchronization (mnemonic: e is for echo) +# sends input to all panes in a given window. +bind e setw synchronize-panes on +bind E setw synchronize-panes off + +# set first window to index 1 (not 0) to map more to the keyboard layout... +set -g base-index 1 + +# color scheme (styled as vim-powerline) +set -g status-left-length 52 +set -g status-right-length 451 +set -g status-fg white +set -g status-bg colour234 +set -g pane-border-fg colour245 +set -g pane-active-border-fg colour39 +set -g message-fg colour16 +set -g message-bg colour221 +set -g message-attr bold +set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #S #[fg=colour252,bg=colour238,nobold]⮀#[fg=colour245,bg=colour238,bold] #(whoami) #[fg=colour238,bg=colour234,nobold]⮀' +set -g window-status-format "#[fg=colour235,bg=colour252,bold] #I #W " +#set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=colour25,bg=colour39,noreverse,bold] #I ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀" +#set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=black,bg=colour39,noreverse,bold] #I ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀" +set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=black,bg=colour39,noreverse,bold] #I: #W #[fg=colour39,bg=colour234,nobold]⮀" + +# Patch for OS X pbpaste and pbcopy under tmux. +# set-option -g default-command "reattach-to-user-namespace -l zsh" + +# Screen like binding +unbind C-b +set -g prefix C-a + +# No escape time for vi mode +set -sg escape-time 0 + +# Screen like binding for last window +unbind l +bind C-a last-window + +# Bigger history +set -g history-limit 10000 +#