-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf.local
96 lines (71 loc) · 3.06 KB
/
tmux.conf.local
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
# Reload tmux.conf shortcut
# improve colors
set -g default-terminal 'screen-256color'
set -g status-keys 'emacs'
# ==== BINDINGS ==== #
# act like GNU screen
unbind C-b
set -g prefix C-a
# Reload tmux conf with prefix-r shortcut
bind-key r source-file ~/dotfiles-local/tmux.conf.local \; display-message '~/dotfiles-local/tmux.conf.local reloaded'
# Create new tmux window from current pane directory context
bind c new-window -c '#{pane_current_path}'
# Kill tmux session
bind-key K run-shell 'tmux switch-client -n \; kill-session -t "$(tmux display-message -p "#$")" || tmux kill-session'
# Select tmux session based on title fuzzy search (dependency: sed, fzf)
bind-key C-j split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#$')\$\" | fzf --reverse | xargs tmux switch-client -t "
# Move tmux pane to window pane
bind-key b break-pane -d
# Smart vim like pane switching | tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# Pane resizing
# Shift(small resize) + arrow key
bind -n S-Left resize-pane -L 2
bind -n S-Right resize-pane -R 2
bind -n S-Down resize-pane -D 1
bind -n S-Up resize-pane -U 1
# Control(big resize) + arrow key
bind -n C-Left resize-pane -L 10
bind -n C-Right resize-pane -R 10
bind -n C-Down resize-pane -D 5
bind -n C-Up resize-pane -U 5
# ==== OPTIONS ====
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# increase scrollback lines
set -g history-limit 10000
# ==== THEME ====
# soften status bar color from harsh green to light gray
set -g status-bg '#282935'
set -g status-fg '#aaaaaa'
# remove administrative debris (session name, hostname, time) in status bar
set -g status-right '#(date "+%a, %b %d - %I:%M")'
# set statusbar position
set -g status-position bottom
# # Set session name to the left
set -g status-left "#[fg=colour236,bg=colour166] #S "
set -g status-left-length 32
# set panes center
set -g status-justify centre # set tabs in center
setw -g window-status-format "#[fg=white,bg=blue] #I #[bg=colour236,fg=white] #W "
setw -g window-status-current-format "#[bg=colour220,fg=colour236] #I #[fg=white,bold,bg=colour236] #W "
set-option -g status-bg colour235 #base02 status bar background color
set-option -g status-fg colour136 #yellow
# set date and time to the right
set -g status-right '#(date "+%R")'
# pane number display
set-option -g display-panes-active-colour colour220 #yellow
set-option -g display-panes-colour blue #blue
# clock
set-window-option -g clock-mode-colour colour220 #yellow
set -g status-interval 1
# Enable scrolling in tmux
set -g mouse on