-
Notifications
You must be signed in to change notification settings - Fork 1
/
tmux.conf
82 lines (63 loc) · 3.71 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
## ============================================================================
## Key Bindings
## ============================================================================
set -g prefix C-b
# Set a Ctrl-b shortcut for reloading your tmux config
bind r source-file ~/.tmux.conf
bind-key s resize-pane -x 100
bind-key S resize-pane -y 30
# The exact width of my monitor for a side-by-side split
bind-key W resize-pane -x 284
# Synchronizing
bind-key A setw synchronize-panes
# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|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 '(^|\/)g?(view|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 '(^|\/)g?(view|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 '(^|\/)g?(view|vim?)(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
# "Get" aliases into window
bind-key g send-keys "source /u/hipple/git/personal/dotfiles_local/bin_local/tmux-aliases.sh" enter
# Set to vi and fix the term if we've ssh'd / sudo'd somewhere else
bind-key t send-keys "export TERM=xterm-256color; set -o vi; clear; cd" enter
# Move windows left and right, following focus along
bind-key h swap-window -t -1\; select-window -t -1
bind-key l swap-window -t +1\; select-window -t +1
## ============================================================================
## Settings
## ============================================================================
set -g default-terminal "xterm-256color"
set -ag terminal-overrides ",xterm-256color:Tc"
# Use vim bindings
setw -g mode-keys vi
set -g status-keys vi
set -sg escape-time 0
# Don't automatically rename windows
set-window-option -g allow-rename off
set -g history-limit 50000
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
## ============================================================================
## Status Bar
## ============================================================================
# Put the status bar on top
set -g status-position top
# Left side of status bar
# Show session name and hostname in my choice of colors
set -g status-left-length 20
set -g status-left '#[fg=green][#[bg=black,fg=cyan]#S#[bg=black,fg=blue,dim]:#H#[fg=green]]'
## Middle of status bar, window labels
# Inactive windows in status bar
set-window-option -g window-status-format '#[fg=cyan,dim]#I#[fg=blue]:#[default]#W#[fg=grey,dim]#F'
# Current or active window in status bar
set-window-option -g window-status-current-format '#[bg=blue,fg=cyan,bold]#I#[bg=blue,fg=cyan]:#[fg=white]#W#[fg=dim]#F'
# Right side of status bar
set -g status-right '#T | %Y-%m-%d #(date +%%I:%%M) '
## ============================================================================
## Plugins
## ============================================================================
# These plugins are installed via the nix attributes tmuxPlugins.<plugin>
run-shell '~/.nix-profile/share/tmux-plugins/copycat/copycat.tmux' # Regex searches, highlighting, and predefined searches
run-shell '~/.nix-profile/share/tmux-plugins/open/open.tmux' # Bindings for opening files
run-shell '~/.nix-profile/share/tmux-plugins/sensible/sensible.tmux' # Sensible defaults
run-shell '~/.nix-profile/share/tmux-plugins/yank/yank.tmux' # Copying to system clipboard and other copying shortcuts