-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
88 lines (75 loc) · 2.87 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
# session management
# tmux new -s session_name (prefix :new -s session_name)
# tmux a -t session_name (prefix :attach -t session_name)
# tmux switch -t session_name
# tmux ls (list-session)
# tmux detach (prefix + d)
# tmux kill-session -t session_name
# Shortcuts within tmux
# prefix + s = list session
# prefix + $ = name session
# prefix + d = detach session
# window management
# tmux new-window (prefix + c)
# tmux select-window -t :0-9 (prefix + 0-9)
# tmux rename-window (prefix + ,)
# Shortcuts within tmux
# prefix + c = new window
# prefix + , = name window
# prefix + w = list windows
# prefix + f = find windows
# prefix + & = kill window
# prefix + . = move window - promted for a new number
# :movew<CR> move window to the next unused number
# pane management
# tmux split-window (prefix + ") - vertical
# tmux split-window -h (prefix + %) - horizontal
# tmux swap-pane -[UDLR] (prefix + { or })
# tmux select-pane -[UDLR] (preix + arrow keys)
# tmux select-pane -t :.+ (select next pane in numerical order)
# pane shortcuts
# " horizontal split
# % vertical split
# o swap panes
# q show pane numbers
# x kill pane
# space - toggle between layouts
# set background color of highlighted pane to black (colour16)
#setw -g window-active-style bg=colour16
# Smart pane switching with awareness of vim splits
# # See: https://github.com/christoomey/vim-tmux-navigator
#is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(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"
# User configuration goes here
# This is a configuration for tmux 2.1
# https://stackoverflow.com/questions/21005966/tmux-prompt-not-following-normal-bash-prompt-ps1-w
set-option -g default-command bash
# set shortcut for reloading the config
bind r source-file ~/.tmux.conf \; display-message "source-file done"
# status bar
# TODO(sandeep) figure out why this is not working
set -g set-titles on
# set -g set-titles-string '#(whoami)::#h::#(curl ipecho.net/plain;echo)'
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
set -g status-justify left
set -g status-right '#[fg=Cyan]#S #[fg=white]%a %d %b %R'
# enable the mouse in tmux
set -g mouse on
# http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting-ubuntu/
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# vim like bind
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R