Last active
April 1, 2017 23:09
-
-
Save dingbat/c1aec7e7fce1b1ad80304cb378ffe281 to your computer and use it in GitHub Desktop.
tmux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # switch key bind | |
| set -g prefix C-s | |
| unbind C-b | |
| bind C-s send-prefix | |
| bind C-l send-keys 'C-l' | |
| # set up the colors | |
| set -g default-terminal "screen-256color" | |
| set-option -g default-shell $SHELL | |
| # Status bar | |
| set -g status-fg white | |
| set -g status-bg default | |
| set -g status-justify centre | |
| set -g status-left-length 20 | |
| set -g status-right "#[fg=green]][#[fg=magenta]#(osascript ~/bin/listening_to.scpt) #[fg=cyan]%m/%d #[fg=green]%H:%M]" | |
| set -g status-left "#{prefix_highlight}#[fg=green][#(hostname | awk -F. '{print $1}').#S][" | |
| setw -g window-status-current-format '#[fg=red,bg=default]( #I:#W )#[fg=default]' | |
| setw -g window-status-activity-attr none | |
| setw -g window-status-activity-fg yellow | |
| # 0 is too far from 1 :) | |
| set -g base-index 1 | |
| setw -g pane-base-index 1 | |
| # use vi type movements | |
| setw -g mode-keys vi | |
| bind h select-pane -L | |
| bind j select-pane -D | |
| bind k select-pane -U | |
| bind l select-pane -R | |
| bind u previous-window | |
| bind i next-window | |
| is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"' | |
| bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" | |
| bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" | |
| bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" | |
| bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" | |
| bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" | |
| # easy to remember splitting | |
| bind \ split-window -h | |
| bind - split-window | |
| # border color | |
| set -g pane-active-border-bg cyan | |
| set -g pane-border-fg cyan | |
| # mouse type things | |
| set-option -g bell-action any | |
| set-option -g visual-bell off | |
| setw -g monitor-activity on | |
| # useful shortcuts | |
| bind r source-file ~/.tmux.conf\; display-message " Config reloaded.." | |
| #bind j command-prompt "join-pane -s :'%%'" | |
| # make copy and paste simmilar to vim | |
| setw -g mode-keys vi | |
| unbind [ | |
| unbind p | |
| bind y copy-mode | |
| bind p paste-buffer | |
| bind -t vi-copy v begin-selection | |
| bind -t vi-copy y copy-selection | |
| # clear screen | |
| bind-key K send-keys "clear && tmux clear-history" \; send-keys "Enter" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment