-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
executable file
·105 lines (83 loc) · 3.01 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
# As you can see below, my tmux prefix is
# Ctrl + J, I set it up this way to not conflict
# with some of my vim key bindings
# Unbind some default keys
unbind C-b
unbind Up
unbind Down
unbind Left
unbind Right
unbind Space
unbind M-1
unbind M-2
unbind M-3
unbind M-4
unbind M-5
unbind '"'
unbind %
set -g default-shell $SHELL
set -g history-limit 10000
set-option -sg escape-time 10
set-option -g focus-events on
set-option -sa terminal-overrides ',XXX:RGB'
# enable usage of the macOS system clipboard
# required: brew install reattach-to-user-namespace
# only enable this option in macOS otherwise tmate won't work in *nix OSes
set-option -g default-command "which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL || $SHELL"
# set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
# set-environment -g SSH_AUTH_SOCK $HOME/.ssh/ssh-auth-sock.$HOSTNAME
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Bind ']' to use pbpaste
bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
setw -g xterm-keys on
set-option -g prefix C-j
bind C-j send-prefix
# splitting panes (maintains the previous path)
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Quick window selection
bind a last-window
bind -r n next
bind -r p prev
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
bind-key -r Space next-layout
# Pane resizing
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Set the default terminal mode to 256color mode
set -g default-terminal "screen-256color"
# Names and numbers
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# Set up the status line
set -g status-interval 3
set-option -g status on
set-option -g status-bg "colour236"
set-option -g status-fg green
set-option -g status-justify centre
set-option -g status-keys vi
set -g status-left-length 40
set -g status-right-length 80
# Reload the file with Prefix r
# START:reload
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Instead of using the machine name from hostname, override with the more flexible $HOST variable
set-option -g status-left "[#(echo $HOST)] #[fg=yellow]#I#[fg=green]:#[fg=cyan]#P"
set-option -g window-status-current-format "#[fg=red](#[fg=white]#[fg=colour3]#I:#W#F#[fg=red])"
set-option -g status-right "#[fg=colour190]#(osascript ~/.dotfiles/bin/tunes.scpt) | #[fg=colour039]%m-%d-%Y | #[fg=colour199]%H:%M"