-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
164 lines (136 loc) · 7.57 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
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
# .tmux.conf
# ████████╗███╗ ███╗██╗ ██╗██╗ ██╗
# ╚══██╔══╝████╗ ████║██║ ██║╚██╗██╔╝
# ██║ ██╔████╔██║██║ ██║ ╚███╔╝
# ██║ ██║╚██╔╝██║██║ ██║ ██╔██╗
# ██║ ██║ ╚═╝ ██║╚██████╔╝██╔╝ ██╗
# ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
# General setup
set -g default-terminal "screen-256color" # Colorize stuff
set -g default-command "${SHELL}" # Use default shell
set-option -g default-shell /bin/bash # Make it bash
# Set prefix keys
#set -g prefix C-Space
set -g prefix `
unbind-key C-b
bind-key ` send-prefix
# Make the terms start at 1 instead of 0
set -g base-index 1
set-window-option -g pane-base-index 1
set-window-option -g automatic-rename off
set -g history-limit 10000
set -g bell-action any
set -g set-titles on
set -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name,active (or not)
set -g allow-rename off
set -g visual-bell on
set -g focus-events on
set -g display-time 4000 # Display messages for 4 seconds
# VIMize tmux
set -g status-keys vi # vi style key bindings
setw -g mode-keys vi # vi style mode keys (controls maps in copy mode, etc...)
# Pane Movement
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Pane Resize
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
# 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}"
# more settings to make copy-mode more vim-like
unbind [
bind Enter copy-mode
bind Escape copy-mode
unbind p
bind p paste-buffer
# Copy and Paste Shenanigans
if-shell -b 'uname | grep -q Darwin' {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
} {
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
}
# bind -T vi-copy 'v' begin-selection
# bind -T vi-copy 'y' copy-pipe "reattach-to-user-namespace pbcopy"
# bind -Tcopy-mode-vi 'v' begin-selection
# bind -Tcopy-mode-vi 'y' copy-selection
# Taken from oh-my-tmux https://github.com/gpakosz/.tmux
# copy to Mac OSX clipboard
# if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"'
# copy to X11 clipboard
# if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"'
# if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
# copy to Windows clipboard
# if -b 'command -v clip.exe > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | clip.exe"'
# if -b '[ -c /dev/clipboard ]' 'bind y run -b "tmux save-buffer - > /dev/clipboard"'
# Spotify integration (requires spotifyctl script to be in your path)
if-shell -b 'uname | grep -q Darwin' {
unbind C-N
bind C-N run-shell "~/bin/spotifyctl -n"
bind C-P run-shell "~/bin/spotifyctl -v"
bind C-Space run-shell "~/bin/spotifyctl -p"
} {
unbind C-N
bind C-N run-shell "~/bin/spotifyctl -n"
bind C-P run-shell "~/bin/spotifyctl -v"
bind C-Space run-shell "~/bin/spotifyctl -p"
}
# Monitors other screens for activity
setw -g monitor-activity off
set -g visual-activity off
# --- Status Bar --- #
set -g status-position bottom
set -g status-justify left
set -g status-bg default
set -g status-fg white
set -g status-bg black
set -g status-fg white
set -g window-status-format "#[fg=black,bg=magenta] #I #[fg=cyan,bg=brightblack] #W "
set -g window-status-current-format "#[fg=black,bg=brightmagenta] #I #[fg=brightcyan,bg=brightblack,bold] #W "
set -g status-left-length 40
set -g status-right-length 100
# Make status bar all fancy
# Left Side
# set -g status-left '#[fg=green][ #[fg=red]#h#[fg=green]:#[fg=white]#S #[fg=green]][#{prefix_highlight}#[fg=green]]#[default]'
set -g status-left ' #[fg=magenta]#h : #[fg=white]#S #{prefix_highlight} #[default]'
# Right Side
if-shell -b "uname | grep -q Darwin" {
set -g status-right ' #[fg=blue,bright]#(atcal tmux | head -2 | tail -1) 🎵#[fg=magenta]#(~/bin/spotifyctl -c) #[fg=yellow]#(gmail_check) #[fg=yellow]#{battery_status}#{battery_bar}#{battery_percentage} #[fg=yellow] %l:%M%p - %a %m-%d-%Y #[default]'
} {
set -g status-right '🎵 #[fg=magenta]#(~/bin/sp -c) #[fg=yellow]#(gmail_check) #[fg=yellow]#{battery_icon}#{battery_percentage} #[fg=yellow]🕔 %l:%M%p - %a %m-%d-%Y #[default]'
}
#set -g status-right '🎵 #[fg=magenta]#(~/bin/sp -c) #[fg=yellow]#(gmail_check) #[fg=yellow]#{battery_icon}#{battery_percentage} #[fg=yellow]🕔 %l:%M%p - %a %m-%d-%Y #[default]'
set -g status-right '#{cpu_bg_color}#[fg=black] CPU:#{cpu_percentage} #{ram_bg_color}#[fg=black] RAM:#{ram_percentage} #[bg=magenta]#[fg=black] 🎵#(/usr/bin/playerctl metadata --format "{{ artist }} - {{ title }}")#[fg=black] #{battery_color_bg} #{battery_icon} #{battery_percentage} #{battery_remain} #[bg=yellow]#[fg=black] %a %b %d %Y -%l:%M%p %Z #[default]'
#set -g status-right '📆 #[fg=blue,bright]#(atcal tmux | head -2 | tail -1) 🎵 #[fg=magenta]#(~/bin/spotifyctl -c) #[fg=yellow]#(gmail_check) #[fg=yellow] #[fg=green] #{battery_color_bg} #{battery_icon} #{battery_percentage} #{battery_remain} #[bg=yellow]#[fg=black] %l:%M%p - %a %m-%d-%Y #[default]'
# Prefix-r reloads the tmux config file
bind r source-file ~/.tmux.conf
# Make prefix-e turn on synchronize-panes and prefix-E turn it off.
# This is to simulate clusterSSH type functionality that sends input to all windows
bind e setw synchronize-panes on
bind E setw synchronize-panes off
set -g mouse off
# sane scrolling:
#bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
# List of plugins
# Supports `github_username/repo` or full git URLs
set -g @plugin 'tmux-plugins/tpm' # Plugin Manager
set -g @plugin 'tmux-plugins/tmux-yank' # yanking in tmux copies into system clipboard (Requires xsel on X, or wl-clipboard in wayland)
set -g @plugin 'tmux-plugins/tmux-copycat' # better searching and highlighting
set -g @plugin 'tmux-plugins/tmux-open' # Quickly open highlighted files
set -g @plugin 'tmux-plugins/tmux-prefix-highlight' # Simply show an indicator that your prefix key has been activated
set -g @plugin 'tmux-plugins/tmux-logging' # Easily dump pane contents to a file
set -g @plugin 'tmux-plugins/tmux-battery' # Battery indicator in status bar
# set -g @plugin 'tmux-plugins/tmux-maildir-counter' # Unread email indicator in status bar
set -g @plugin 'tmux-plugins/tmux-urlview' # Quickly open URLs from your terminal window
set -g @plugin 'tmux-plugins/tmux-cpu' # CPU stats
# set -g @plugin 'tmux-plugins/tmux-sidebar' # Sidebar with path
set -g @plugin 'tmux-plugins/tmux-gmail' # Mail count from gmail
set -g @plugin 'christoomey/vim-tmux-navigator' # VIM and Tmux integration
# set -g @plugin 'arcticicestudio/nord-tmux' # Nord color theme
run '~/.tmux/plugins/tpm/tpm'