-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_tmux.conf
143 lines (113 loc) · 4.88 KB
/
dot_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
# =============================================================================
# .tmux.conf
# Author: Joakim Engeset <[email protected]>
# =============================================================================
# friendship ended with tmux
# now wezterm w/ local multiplexing server is my best friend
# Change prefix from C-b to C-a
unbind C-b ; set -g prefix C-a
# pressing C-a twice sends the keys through to the application
bind C-a send-prefix
# Specify terminal to use inside tmux
set-option -g default-terminal "screen-256color"
# add support for 24-bit colors
set-option -ga terminal-overrides ",xterm-256color:Tc"
# prolong the time messages are displayed
set-option -g display-time 2000
# when a window is clused, automatically renumber remaining windows
set-option -g renumber-windows on
# session options
set -g mouse on
# scrollback-size
set -g history-limit 5000
set -sg escape-time 1
# make window-index start at 1
set -g base-index 1
# make pane-index start at 1
setw -g pane-base-index 1
# windows options
setw -g clock-mode-colour green
setw -g clock-mode-style 24
setw -g mode-keys vi
bind r source-file ~/.tmux.conf\; display "configuration reloaded!"
bind -n C-n send-keys 'C-l'
bind C-l send-keys 'C-l'
# managing panes
unbind |; bind v split-window -h -c "#{pane_current_path}"
unbind -; bind x split-window -v -c "#{pane_current_path}"
bind -r H resize-pane -L 5
# managing windows
bind c new-window -c "#{pane_current_path}"
# navigating previous/next window
bind -r C-j previous-window
bind -r C-k next-window
# resizing panes
unbind C-Left ; bind -rn C-Left resize-pane -L 5
unbind C-Right ; bind -rn C-Right resize-pane -R 5
unbind C-Down ; bind -rn C-Down resize-pane -D 3
unbind C-Up ; bind -rn C-Up resize-pane -U 3
# display message on window activity
setw -g monitor-activity on
# display message on window activity
set -g visual-activity on
bg=default
fg=white
border_active=blue
border_inactive=black
set -g default-shell "/opt/homebrew/bin/fish"
# styles, replacing -bg/-fg/attr
set -g status-style bg=$bg
set -g pane-border-style fg=$border_inactive
set -g pane-active-border-style bg=$bg,fg=$border_active
# left status (hide session name)
set -g status-left ''
# main status
setw -g window-status-format "#[fg=$bg]#I#[fg=$bg]:#[default]#W#[fg=grey,dim]#F"
setw -g window-status-current-format "#[fg=white,bold][#I#[fg=white,bold]:#[fg=green,bold]#W#[fg=dim,bold]#F#[fg=white,bold]]"
# right status
set -g status-right "#(/bin/bash $HOME/.tmux/kube-tmux/kube.tmux 350 red cyan)"
# VARIABLES
#
# %H Hostname of local host
# %h Hostname of local host without the domain name #F Current window flag
# %I Current window index
# %P Current pane index
# %S Current session name
# %T Current window title
# %W Current window name
# %# A literal #
# %(shell-command) First line of the shell command’s output #[attributes] Color or attribute change
# vim-tmux-navigator
# is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
# this check is faster than the old one. https://github.com/alexghergh/nvim-tmux-navigation/issues/16
is_vim="tty=#{pane_tty} ; pgrep -t \${tty#/dev/} 'g?(view|n?vim?x?)(diff)?$' >/dev/null 2>&1"
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"
bind-key -n C-\\ if-shell "$is_vim" "send-keys C-h" "select-pane -L"
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
# stupid clipboard settings
bind å copy-mode
bind-key -T edit-mode-vi Up send-keys -X history-up
bind-key -T edit-mode-vi Down send-keys -X history-down
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi [ send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi ] send-keys -X copy-selection
bind-key -n M-j splitw -h
bind-key -n M-k splitw -v
bind-key -n M-l new-window
bind-key -n F2 choose-session
bind-key -n M-z resize-pane -Z
bind-key -n F6 run-shell "aws-chrome $(baws default-account -e build)"
bind-key -n F7 run-shell "aws-chrome $(baws default-account -e dev)"
bind-key -n F8 run-shell "aws-chrome $(baws default-account -e staging)"
bind-key -n F9 run-shell "aws-chrome $(baws default-account -e prod)"
bind-key -n F10 new-window nvim -O ~/.config/nvim/init.lua ~/.config/nvim/lua/plugins.lua