-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
executable file
·130 lines (106 loc) · 5.17 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
# -----------------------------------------------------------------------------
# This config is targeted for tmux 2.1+ and should be placed in ~/.tmux.conf
# Read the "Plugin Manager" section (bottom) before trying to use this config!
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Change the default prefix key from CTRL+B to `
# -----------------------------------------------------------------------------
set -g prefix è
bind è send-prefix
# -----------------------------------------------------------------------------
# Global options
# -----------------------------------------------------------------------------
# Add a bit more scroll history in the buffer.
set -g history-limit 50000
# Enable color support inside of tmux.
set -g default-terminal "screen-256color"
# Don't use a separate shell (recover aliases)
set-option -g default-shell "$SHELL"
set-option -g default-command "$SHELL"
# Ensure window titles get renamed automatically.
setw -g automatic-rename
# Ensure window numbering is gapless
set-option -g renumber-windows on
# Mouse support
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Enable full mouse support.
set -g mouse on
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Status bar and colors
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Status bar.
set -g status-fg colour69
set -g status-bg default
set -g status-left ''
set -g status-right-length 0
#set -g status-right "#{battery_status_bg} Batt: #{battery_icon} #{battery_percentage} #{battery_remain}"
# I keep the clock hidden, but uncomment the last 2 lines to enable it
#set -g status-right-length 20
#set -g status-right '%a %Y-%m-%d %H:%M'
set -g pane-border-fg default
set -g pane-border-bg default
set -g pane-active-border-fg colour69
set -g pane-active-border-bg default
# Highlight the active window in the status bar.
set-window-option -g window-status-current-attr bold
set-window-option -g window-status-current-fg colour69
# '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# -----------------------------------------------------------------------------
# Unbind default keys
# -----------------------------------------------------------------------------
unbind C-b
unbind '"'
unbind %
# -----------------------------------------------------------------------------
# Remap new bindings
# -----------------------------------------------------------------------------
# Reload the tmux config.
bind-key r source-file ~/.tmux.conf ; display-message " Config reloaded.."
# Split panes.
bind-key h split-window -v -c "#{pane_current_path}"
bind-key v split-window -h -c "#{pane_current_path}"
# Move around panes with ALT + Arrow keys.
bind-key -n M-Up select-pane -U
bind-key -n M-Left select-pane -L
bind-key -n M-Down select-pane -D
bind-key -n M-Right select-pane -R
bind-key w choose-window
# sync all panes
bind-key -n C-x setw synchronize-panes
# send command to all panes in all windows
bind E command-prompt -p "Command:" \
"run \"tmux list-panes -a -F '##{session_name}:##{window_index}.##{pane_index}' \
| xargs -I PANE tmux send-keys -t PANE '%1' Enter\""
# copy paste behaviour
bind-key -T copy-mode-vi y send-keys -X copy-pipe "xclip -r" \; display-message "Copied to selection"
bind-key -T copy-mode-vi Y send-keys -X copy-pipe "xclip -r -selection clipboard" \; display-message "Copied to clipboard"
bind-key C-p run-shell "xclip -o | tmux load-buffer - && tmux paste-buffer"
# set editor
setenv EDITOR micro
# replicates tmux-open with WSL work.around
bind-key -T copy-mode o send-keys -X copy-pipe-and-cancel "xargs -I {} tmux run-shell -b 'cd \"#{pane_current_path}\"; cmd.exe /C start \"{}\" > /dev/null'"
bind-key -T copy-mode C-o send-keys -X copy-pipe-and-cancel "xargs -I {} tmux send-keys 'micro -- \"{}\"'; tmux send-keys 'C-m'"
bind-key -T copy-mode S send-keys -X copy-pipe-and-cancel "xargs -I {} tmux run-shell -b 'gsearch.sh \"{}\" > /dev/null'"
# -----------------------------------------------------------------------------
# Plugin Manager - https://github.com/tmux-plugins/tpm
# In order to use the plugins below you need to install TPM and the plugins.
# Step 1) git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Step 2) Reload tmux if it's already started with `r
# Step 3) Launch tmux and hit `I (capital i) to fetch any plugins
# -----------------------------------------------------------------------------
# List of plugins.
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-yank'
#set -g @plugin 'tmux-plugins/tmux-open'
#set -g @plugin 'tmux-plugins/tmux-sidebar'
#set -g @plugin 'tmux-plugins/tmux-battery'
#set -g @plugin 'tmux-plugins/tmux-sidebar'
# Settings for tmux-recurrect:
set -g @resurrect-save-bash-history 'on'
# Setting for tmux-sidebar
#set -g @sidebar-tree-position 'right'
#set -g @sidebar-tree-focus 'g'
#set -g @sidebar-tree-command 'tree -C'
# Initialize TPM (keep this line at the very bottom of your tmux.conf).
run -b '~/.tmux/plugins/tpm/tpm'