-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
104 lines (76 loc) · 3.13 KB
/
tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
###########################
# 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"