-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
113 lines (92 loc) · 5.55 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
set -sg escape-time 0
setw -g mode-keys vi
set -s copy-command 'xsel -i --clipboard'
bind q killp
set-option -g default-shell /bin/zsh
set-option -g default-command "zsh -l"
set-option -g focus-events on
set -g status-right-length 60
# vim keys in copy mode
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xsel -i --clipboard'
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel 'xsel -i --clipboard'
bind-key ] run-shell "xsel -o --clipboard | tmux load-buffer - ; tmux paste-buffer"
# bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
# bind -T copy-mode-vi y send -X copy-selection-and-cancel \; run-shell "xsel -i --clipboard"
# bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'xsel -i --clipboard'\; send -X cancel
# bind -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'xsel -i --clipboard'
# bind -T copy-mode y send -X copy-pipe "xsel -i --clipboard --clipboard"
# bind -T copy-mode-vi y send -X copy-pipe "xsel -i --clipboard --clipboard"
# bind-key -T copy-mode-vi y send-keys -X copy-selection \; send-keys -X clear-selection \; send-keys -X cancel
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
bind-key -T copy-mode-vi Escape send-keys -X cancel
# no confirmation
bind-key & kill-window
bind-key x kill-pane
# # Styling from https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# # loud or quiet?
# set -g visual-activity on
# set -g visual-bell off
# set -g visual-silence off
# setw -g monitor-activity off
# set -g bell-action none
# # modes
# setw -g clock-mode-colour colour5
# setw -g mode-style 'fg=colour1 bg=colour18 bold'
# # panes
# set -g pane-border-style 'fg=colour19 bg=colour0'
# set -g pane-active-border-style 'bg=colour0 fg=colour9'
# # statusbar
# set -g status-position bottom
# set -g status-justify left
set -g status-interval 1
set -g status-style 'fg=colour7 bg=colour18'
# set -g status-left "#[fg=blue,bright]#(gcalcli | head -2 | tail -1)#[default]"
# set -g status-left ''
# set -g status-right "#[fg=colour5,bg=colour8] #(test=\"hej"; [[ $test == "no" ]] && date +%s) #[fg=colour233,bg=colour19] %Y-%m-%d #[fg=colour233,bg=colour8] %H:%M "
# set -g status-right "#[fg=colour5,bg=colour18] #(watson status | awk -F 'Project | started | ago' '{print $2 \" \" $3}') #[fg=colour243,bg=colour19] %Y-%m-%d #[fg=colour7,bg=colour21] %H:%M "
set -g status-right "#(taskscript -t)#[fg=colour243,bg=colour19] %Y-%m-%d #[fg=colour7,bg=colour21] %H:%M "
# project_time=$(echo "$data" | awk -F 'Project | started | ago' '{print $2 " " $3}')
# set -g status-right-length 50
# set -g status-left-length 20
# setw -g window-status-current-style 'fg=colour1 bg=colour19 bold'
# setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F '
# setw -g window-status-style 'fg=colour9 bg=colour18'
# setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
# setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold'
# # messages
# set -g message-style 'fg=colour232 bg=colour16 bold'
# These bindings are for X Windows only. If you're using a different
# window system you have to replace the `xsel` commands with something
# else. See https://github.com/tmux/tmux/wiki/Clipboard#available-tools
bind -T copy-mode DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -n TripleClick1Pane select-pane \; copy-mode -M \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xsel -o)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @yank_action 'copy-pipe-no-clear'
# set -g @plugin 'christoomey/vim-tmux-navigator'
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '/usr/share/tmux-plugin-manager/tpm'