-
Notifications
You must be signed in to change notification settings - Fork 2
/
tmux.conf
96 lines (76 loc) · 3.11 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
set -g status-interval 30
# Start numbering at 1
set -g base-index 1
setw -g pane-base-index 1
set-option -g repeat-time 1000
set -sg escape-time 0
set-option -sa terminal-overrides ',xterm-256color:RGB'
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
#setw -g aggressive-resize on
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
# auto window rename
# set-window-option -g automatic-rename
set-option -g allow-rename off
set-option -g renumber-windows on
set-option -g default-command "reattach-to-user-namespace -l zsh"
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# Prefix key.
set -g prefix C-a
unbind C-b
bind C-a send-prefix
#setw -g mode-mouse on
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# bind w choose-tree -u
bind-key S choose-window 'join-pane -v -s "%%"'
bind-key V choose-window 'join-pane -h -s "%%"'
# color
set -g default-terminal "screen-256color"
# osx copy/paste fix
# 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 C-v send-keys -X rectangle-toggle
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-and-cancel
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"
# Vim-like key bindings for pane navigation (default uses cursor keys).
unbind h
bind h select-pane -L
unbind j
bind j select-pane -D
unbind k
bind k select-pane -U
unbind l # normally used for last-window
bind l select-pane -R
bind ` display-popup -E "tmux list-windows -a -F '#{session_name}:#{window_index} - #{window_name}' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | sed -E 's/\s-.*$//' | xargs -r tmux switch-client -t"
# SSH agent stuff
# set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"
# set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
set -g update-environment -r
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'thesharp/maglev'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'jonmosco/kube-tmux'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'
# tmux-resurrect settings
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-processes 'Vim vim "~MacVim.app" "~Vim" nvim'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'