-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.tmux.conf
More file actions
164 lines (128 loc) · 4.37 KB
/
Copy path.tmux.conf
File metadata and controls
164 lines (128 loc) · 4.37 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Start index from 1
set -g base-index 1
set -g history-limit 20000
set buffer-limit 999999
# automatically renumber tmux windows
set -g renumber-windows on
# unbind default prefix and set it to Ctrl+a
unbind-key C-b
set-option -g prefix C-a
bind C-a send-prefix
# for nested tmux sessions
bind-key a send-prefix
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Activity Monitoring
setw -g monitor-activity on
set -g visual-activity on
# Reasonble client size
setw -g aggressive-resize on
# Faster key repetition
set -sg escape-time 0
set -g repeat-time 0
# tile all windows
unbind-key =
bind = select-layout tiled
# cycle through panes
# unbind C-a
# unbind o # this is the default key for cycling panes
# bind ^A select-pane -t:.+
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1
set-option -g set-titles on
set-option -g set-titles-string "#T - #W"
set-window-option -g automatic-rename on
#set-option -g status-interval 5
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path} #{pane_current_command}'
######################
#### Key Bindings ####
######################
# reload config file
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"
# set mouse on with prefix m
bind m \
set -g mouse on \;\
display 'Mouse: ON'
# set mouse off with prefix M
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
# pane movement shortcuts
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# Resize pane shortcuts
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# split window and fix path for tmux 1.9
#bind | split-window -h -c "#{pane_current_path}"
#bind - split-window -v -c "#{pane_current_path}"
# synchronize all panes in a window
#bind y setw synchronize-panes
bind y set -g synchronize-panes
# enable mouse support for switching panes/windows
set-option -g mouse on
#set-window-option -g mode-mouse on
#set -g mouse-select-pane on
#set -g mouse-resize-pane on
#set -g mouse-select-window on
# Use vim keybindings in copy mode
setw -g mode-keys vi
# set -g status-keys vi
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -T copy-mode-vi v send -X begin-selection
if-shell "uname | grep -q Darwin" {
bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'tmux save-buffer - | pbcopy'; \
bind C-c run 'tmux save-buffer - | pbcopy'; \
bind C-v run 'tmux set-buffer "$(pbpaste)"; tmux paste-buffer'
}
if-shell '[[ $(uname -s) = Linux ]]' {
bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -i -sel clipboard'; \
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"; \
bind C-v run 'tmux set-buffer "$(xclip -o -sel clipboard)"; tmux paste-buffer'
}
# Enables Ctrl-Left / Ctrl-Right
set-window-option -g xterm-keys on
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Persists tmux environment across system restarts
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
set -g @plugin 'catppuccin/tmux'
set -g @catppuccin_flavour 'mocha'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @catppuccin_status_modules_right "cpu session"
set -g @catppuccin_status_left_separator "█"
set -g @catppuccin_status_right_separator "█"
set -g @catppuccin_window_right_separator "█ "
set -g @catppuccin_window_number_position "right"
set -g @catppuccin_window_middle_separator " | "
set -g @catppuccin_window_default_fill "none"
set -g @catppuccin_window_current_fill "all"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
##############################
### Color & Style Settings ###
##############################
source $DOTFILES/tmux/base16.sh
#new-window
#new-session
# session picker
bind C-j display-popup -E "tmux list-sessions | sed -E 's/:.*//' | grep -v \"^(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"