-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
executable file
·135 lines (107 loc) · 4.34 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
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
# use UTF-8 encoding
set -gq utf8
set-window-option -gq utf8 on
# set prefix key to c-f
unbind C-b
set -g prefix C-f
bind C-f send-prefix
# toogle last window by hitting again C-f
bind-key C-f last-window
# re-number windows when one is closed
set -g renumber-windows on
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
# show times longer than supposed
set -g display-panes-time 2000
# display messages for 4 seconds
set -g display-time 4000
# set default terminal mode to 256 colors
set -g default-terminal "xterm-256color"
setw -g clock-mode-style 24
# rename window and session
unbind <
bind < command-prompt "rename-window '%%'"
unbind '$'
bind '$' command-prompt "rename-session '%%'"
# reload configuration
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# split horiziontal and vertical splits and open them in the same directory.
bind-key v split-window -h -c '#{pane_current_path}'
bind-key s split-window -v -c '#{pane_current_path}'
# use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# use vim keybindings in copy mode
setw -g mode-keys vi
# select and copy with v and y, instead of default space and enter
bind-key -T edit-mode-vi Up send-keys -X history-up
bind-key -T edit-mode-vi Down send-keys -X history-down
unbind-key -T copy-mode-vi Space ; bind-key -T copy-mode-vi v send-keys -X begin-selection
unbind-key -T copy-mode-vi Enter ; bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
unbind-key -T copy-mode-vi C-v ; bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
unbind-key -T copy-mode-vi [ ; bind-key -T copy-mode-vi [ send-keys -X begin-selection
unbind-key -T copy-mode-vi ] ; bind-key -T copy-mode-vi ] send-keys -X copy-selection
# use Emacs key bindings in tmux command prompt (prefix + :)
set -g status-keys emacs
# focus events enabled for terminals that support them
set -g focus-events on
# faster command sequence
set -s escape-time 0
# limit history
set -g history-limit 1000
# mouse mode on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g mouse on
# set title
set -g set-titles on
set -g set-titles-string "#T"
# equally resize all panes
bind-key = select-layout even-horizontal
bind-key | select-layout even-vertical
# resize panes
bind-key J resize-pane -D 10
bind-key K resize-pane -U 10
bind-key H resize-pane -L 10
bind-key L resize-pane -R 10
# select panes
bind-key j select-pane -D
bind-key k select-pane -U
bind-key h select-pane -L
bind-key l select-pane -R
# lock terminal
set -g lock-command vlock
set -g lock-after-time 0 # seconds; 0 = never
unbind o
bind o lock-client # lock a client
unbind p
bind p lock-session # lock all clients attached to a session
# disable confirm before killing
bind-key x kill-pane
# this tmux statusbar config was created by tmuxline.vim
set -g status "on"
set -g status-bg default
set -g status-justify "left"
set -g status-position "bottom"
set -g status-left-length "100"
set -g status-left-style "none"
set -g status-right-length "100"
set -g status-right-style "none"
set -g status-style "none"
set -g status-left "#{prefix_highlight}#[fg=colour22,bg=colour148,bold] #S #[fg=colour148,bg=colour236,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=colour240,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour250,bg=colour240] %H:%M #[fg=colour252,bg=colour240,nobold,nounderscore,noitalics]#[fg=colour241,bg=colour252] #h "
set -g pane-active-border-style fg="colour148"
set -g pane-border-style fg="colour240"
set -g message-command-style fg="colour231"
set -g message-style bg="colour240"
set -g message-style fg="colour231"
set -g message-command-style bg="colour240"
setw -g window-status-style fg="colour245","none"
setw -g window-status-activity-style fg="colour148",bg="colour236","none"
setw -g window-status-separator ""
setw -g window-status-style bg="colour236"
setw -g window-status-format "#[fg=colour245,bg=colour236] #I #[fg=colour245,bg=colour236]#W "
setw -g window-status-current-format "#[fg=colour236,bg=colour240,nobold,nounderscore,noitalics]#[fg=colour231,bg=colour240] #I #[fg=colour231,bg=colour240]#{?window_zoomed_flag,#[fg=green][],}#W #[fg=colour240,bg=colour236,nobold,nounderscore,noitalics]"