aboutsummaryrefslogtreecommitdiffstats
path: root/_tmux.conf
blob: 3762fe56465769e1ecd0f37d4653fa36967a2ccf (plain)
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
##
## ~/.tmux.conf
##
## Aaron LI
## Created: 2015-01-22
## Updated: 2016-05-01
##
## References:
## [1] tmux: Productive Mouse-Free Development (by Brian P. Hogan)
##     https://pragprog.com/book/bhtmux/tmux
## [2] Copy and Paste in tmux
##     http://dudenbostel.leanside.com/2014/01/copy-paste-in-tmux/
##


## Settings the prefix from 'C-b' to 'C-a'
#set-option -g prefix C-a
#unbind-key C-b
#bind-key C-a send-prefix

## Settings the delay between prefix and command
set-option -gs escape-time 1

## Set the base index for windows to 1 instead of 0
set-option -g base-index 1

## Set the base index for panes to 1 instead of 0
set-window-option -g pane-base-index 1

## Reload the configuration file with 'Prefix-r'
bind r source-file ~/.tmux.conf \; display "Reloaded!"

## More straightforward key bindings for splitting panes
unbind %
bind | split-window -h
unbind '"'
bind - split-window -v

## Move between the split panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

## C-h/C-l to cycle through windows
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+

## Quich cycle through windows
#bind-key -n C-p previous-window
#bind-key -n C-n next-window

## Pane resizing
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5

## Mouse support
#set-window-option -g mode-mouse on
#set-option -g mouse-select-window on
#set-option -g mouse-select-pane on
#set-option -g mouse-resize-pane on

## Set the default terminal mode
set-option -g default-terminal "screen-256color"

## Enable activity alerts
set-window-option -g monitor-activity on
set-option -g visual-activity on

## Vi mode
set-window-option -g mode-keys vi
set-option -g status-keys vi

## Set copy mode
# start copy mode with 'Prefix-Escape'
bind-key Escape copy-mode
# paste the latest buffer with 'Prefix-p'
bind-key p paste-buffer
# delete the most recently copied buffer
bind-key + delete-buffer

# vi-copy settings
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
# change between line- and column-wise selection
bind-key -t vi-copy 'V' rectangle-toggle
bind-key -t vi-copy 'Y' copy-end-of-line

## Scrollback history
set-option -g history-limit 5000

## How long to display messages and other indicators (unit: ms)
set-option -g display-time 3000

## Send multiple commands without pressing Prefix again
set-option -g repeat-time 1000

## Maximize and restore a pane
unbind Up
bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
unbind Down
bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp

## Log output to a text file on demand
bind P pipe-pane -o "cat >> ~/#W.log" \; display "Toggled logging to ~/#W.log"

### Styles ###

## Set the status line
set-option -g status-style "bg=default"
set-option -g status-justify centre
set-option -g status-left-length 30
set-option -g status-right-length 30
set-option -g status-left " #[fg=yellow,bold]#h:#[fg=blue,bold]#S #[fg=magenta,bold]|#[default]"
set-option -g status-right "#[fg=magenta,bold]| #[fg=yellow,bold]%a %m/%d #[fg=blue,bold]%H:%M "

set-window-option -g window-status-style "fg=blue,bold"
set-window-option -g window-status-current-style "fg=blue,bold,reverse"
set-window-option -g window-status-format "#I:#{=10:window_name}#F"
set-window-option -g window-status-current-format "#I:#W#F"

## command/message line style
set-option -g message-style "fg=white,bold,bg=blue"


# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=tmux: #