-
Notifications
You must be signed in to change notification settings - Fork 2
/
.tmux.conf
56 lines (47 loc) · 1.96 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
# Set prefix
set-option -g prefix "c-t"
# Try to fix the 'session not found' error
set -g base-index 1
set -g pane-base-index 1
set-window-option -g xterm-keys on
# Set a shortcut for reloading your tmux config
bind r source-file ~/.tmux.conf
# Rename your terminals
set -g set-titles on
#set -g set-titles-string '#(whoami)::#h::#(curl ipecho.net/plain;echo)'
set -g set-titles-string '#S' # I used to work on local machine, so the name of session counts
# Status bar customization
set -g status-utf8 on
set -g status-bg black
set -g status-fg white
set -g status-interval 5
set -g status-left-length 90
set -g status-right-length 60
# TODO find the ip echo back when my ip address is not banned
#set -g status-left "#[fg=Green]#(whoami)#[fg=white]::#[fg=blue]#(hostname -s)#[fg=white]::#[fg=Red]#(curl ipecho.net/plain;echo)"
set -g status-left "#[fg=Green]#(whoami)#[fg=white]::#[fg=blue]#(hostname -s)"
set -g status-justify left
set -g status-right '#[fg=Cyan]#S #[fg=white]%a %d %b %R'
# Remap window navigation to vim
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
# Fix clipboard on osx
#set-option -g default-command "reattach-to-user-namespace -l zsh"
# pane movement
bind-key J command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key S command-prompt -p "send pane to:" "join-pane -t '%%'"
# I don't want to always press the prefix key
## window navigation
bind-key -r ^N next-window
bind-key -r n next-window
bind-key -r ^P previous-window
bind-key -r p previous-window
# quick interactive jump to window
bind b split-window "tmux lsw | percol --initial-index $(tmux lsw | awk '/active.$/ {print NR-1}') | cut -d':' -f 1 | tr -d '\n' | xargs -0 tmux select-window -t"
bind B split-window "tmux ls | percol --initial-index $(tmux ls | awk \"/^$(tmux display-message -p '#{session_name}'):/ {print NR-1}\") | cut -d':' -f 1 | tr -d '\n' | xargs -0 tmux switch-client -t"