-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
140 lines (112 loc) · 3.82 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
# author: evilr00t
# update: 2021-12-08T10:17:39+0000
# command prefix:
set-option -g prefix ^a
# when using tmux in tmux (for ex. remote session) - use Ctrl + b as a prefix
bind-key -n C-b send-prefix
set -g bell-action none
setw -g mode-keys vi
# setw -g automatic-rename
setw -g aggressive-resize on
setw -g xterm-keys on
# basic global settings:
set-option -g default-shell /usr/local/bin/zsh
set-option -g status-keys vi
set-window-option -g mode-keys vi
setw -g mouse on
set-option -g renumber-windows on
set-option -g base-index 1
set-option -g history-limit 50000
set-option -g focus-events on
bind -n S-Left previous-window
bind -n S-Right next-window
# from: https://waylonwalker.com/tmux-fzf-session-jump/
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"
# Relax!
set -sg escape-time 0
set -sg repeat-time 600
# copy mode to escape key:
unbind-key [
bind-key Escape copy-mode
# Start copy mode when scrolling up
#bind -n WheelUpPane copy-mode
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# We need reattach-to-user-namespace
# Use v to trigger selection
bind-key -T copy-mode-vi v send-keys -X begin-selection
# Use y to yank current selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
# current window navigation:
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# moving and swapping:
bind-key w swap-pane -D
bind-key e swap-pane -U
# resizing:
bind-key -r C-h resize-pane -L
bind-key -r C-j resize-pane -D
bind-key -r C-k resize-pane -U
bind-key -r C-l resize-pane -R
# splitting and cycling:
unbind %
unbind c
unbind i
unbind l
unbind s
bind F12 source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
unbind '"'
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}"
bind-key = split-window -h -c "#{pane_current_path}"
bind-key C-a last-window
bind-key C-n next-window
bind-key C-p previous-window
# vim-like pane switching
bind -r ^ last-window
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
bind -r D neww -c "#{pane_current_path}" "[[ -e TODO.md ]] && nvim TODO.md || nvim ~/.todo.md"
# bind c neww
bind m choose-window
bind a choose-session
# bind t set status
# window title:
set-option -g set-titles on
set-option -g set-titles-string '#T'
# messages:
set -g status-style "fg=colour251"
# panes:
set-option -g pane-border-style "fg=black"
set-option -g display-panes-colour white
set-option -ag pane-active-border-style "fg=green"
set-option -g display-panes-active-colour red
# status bar:
set -g status-bg default
set -g status-fg colour27
set -g status-left-length 30
set -g status-left '#[fg=colour9]#H#[default]'
set -g status-right ""
set -g status-justify centre
setw -g window-status-format '#[fg=colour9,bold]#I#[fg=colour5]:#[fg=colour11]#W '
setw -g window-status-current-format '#[fg=colour4,bold][#[fg=colour14]#I#[fg=white]:#[fg=colour9]#W#[fg=colour4]]'
set-option -g bell-action any
set-option -g visual-bell off
set-option -g visual-activity off
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
set-window-option -g monitor-activity off
# clock:
set-window-option -g clock-mode-colour cyan
set-window-option -g clock-mode-style 12
# List of plugins -> https://github.com/tmux-plugins/tpm
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'raviqqe/tmux-wincwd'
set -g @plugin 'tmux-plugins/tmux-yank'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'