Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
104 lines (76 sloc)
3.13 KB
This file contains 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
########################### | |
# Configuration | |
########################### | |
# Default theme and variant. | |
# TODO Make "dark" variable based on current OS setting. | |
TMUX_THEME_NAME=nightowl | |
TMUX_THEME_VARIANT=dark | |
# Remap prefix key | |
unbind C-b | |
set -g prefix C-s | |
bind C-s send-prefix | |
# Use 256 term for pretty colors | |
set -g default-terminal "screen-256color" | |
set -ga terminal-overrides ",*256col*:Tc" | |
set -g status-keys "emacs" | |
# Increase scroll-back history | |
set -g history-limit 5000 | |
# Decrease command delay (increases vim responsiveness) | |
set -sg escape-time 1 | |
# Increase repeat time for repeatable commands | |
set -g repeat-time 1000 | |
# Start window at 1 since 0 is too far away | |
set -g base-index 1 | |
# Re-number windows when one is closed | |
set -g renumber-windows on | |
# Don't rename windows automatically | |
set -g allow-rename off | |
set -g mouse on | |
set -g default-command "reattach-to-user-namespace -l fish" | |
########################### | |
# Key bindings | |
########################### | |
# Smart pane switching with awareness of vim splits | |
# See this blog post for additional detail: | |
# http://robots.thoughtbot.com/post/53022241323/seamlessly-navigate-vim-and-tmux-splits | |
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ | |
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?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" | |
# Reload config file | |
bind r source-file ~/.tmux.conf \; display-message "Reloaded tmux.conf" | |
# Start window on current path | |
bind c new-window -c '#{pane_current_path}' | |
# Use vim key bindings | |
setw -g mode-keys vi | |
bind-key - split-window -v -c '#{pane_current_path}' | |
bind-key \\ split-window -h -c '#{pane_current_path}' | |
# Resize panes with ease | |
bind -n S-Left resize-pane -L 2 | |
bind -n S-Right resize-pane -R 2 | |
bind -n S-Down resize-pane -D 1 | |
bind -n S-Up resize-pane -U 1 | |
# Note: MacOS uses these shortcuts for Mission Control, disable them in System Preferences | |
bind -n C-Left resize-pane -L 10 | |
bind -n C-Right resize-pane -R 10 | |
bind -n C-Down resize-pane -D 5 | |
bind -n C-Up resize-pane -U 5 | |
bind C-j split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v '^'(tmux display-message -p '#S')'\$' | fzf --reverse | xargs tmux switch-client -t" | |
bind Tab switch-client -l | |
bind C-b send-keys 'tmux_create_if_needed_and_attach; and exit' 'C-m' | |
bind K run-shell 'tmux switch-client -n \; kill-session -t "(tmux display-message -p "#S")" || tmux kill-session' | |
########################### | |
# Status Bar | |
########################### | |
# Set refresh interval for status bar | |
set -g status-interval 30 | |
set -g status-justify left | |
set -g status-left-length 50 | |
set-window-option -g status-left " #S " | |
set-window-option -g status-right " %H:%M %b %d %Y " | |
set-window-option -g window-status-format " #I: #W #{E:?window_zoomed_flag,🔍,} " | |
set-window-option -g window-status-current-format " #I: #W #{E:?window_zoomed_flag,🔍,} " | |
source-file "~/.tmux-themes/$TMUX_THEME_NAME/$TMUX_THEME_VARIANT.conf" |