-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
93 lines (69 loc) · 2.69 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
# tmux >= 2.4
# Change the prefix.
unbind ^B
set -g prefix C-t
set -s escape-time 1
# reload conf
bind ^R source-file ~/.tmux.conf \; display "Reloaded!"
set-window-option -g mode-keys vi
# 256色ターミナル
set-option -g default-terminal "screen-256color"
# mouse
setw -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# new window
unbind ^C
bind ^C new-window -n fish -c "#{pane_current_path}"
# switch window
unbind ^N
bind ^N next-window
# switch window back
unbind ^P
bind ^P previous-window
# copy-mode ^[
unbind ^[
bind ^[ copy-mode
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection
if-shell '[[ $OSTYPE =~ darwin ]]' "bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'"
if-shell '[[ $OSTYPE =~ darwin ]]' "bind -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'"
# split pane
bind ^S split-window -v -c "#{pane_current_path}"
bind ^V split-window -h -c "#{pane_current_path}"
# swap pane
unbind K
bind K swap-pane -d -t :+.top
unbind J
bind J swap-pane -d -t :+.bottom
unbind H
bind H swap-pane -d -t :+.left
unbind L
bind L swap-pane -d -t:+.right
# switch pane
bind ^T run "tmux last-pane || tmux last-window || tmux new-window"
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# status line を更新する間隔を 1 秒にする
set-option -g status-interval 1
# window-status を中央揃えで配置する
set-option -g status-justify "centre"
# status line の背景色を指定する。
set-option -g status-bg "colour238"
# status line の文字色を指定する。
set-option -g status-fg "colour255"
# status-left の最大の長さを指定する。
set-option -g status-left-length 20
# status-left のフォーマットを指定する。
set-option -g status-left "#[fg=colour255,bg=colour241]Session: #S #[default]"
# status-right の最大の長さを指定する。
set-option -g status-right-length 60
# status-right のフォーマットを指定する。
set-option -g status-right "#[fg=colour255,bg=colour241] #h | LA: #(cut -d' ' -f-3 /proc/loadavg) | %m/%d %H:%M:%S#[default]"
# window-status のフォーマットを指定する。
set-window-option -g window-status-format " #I: #W "
# カレントウィンドウの window-status のフォーマットを指定する
set-window-option -g window-status-current-format "#[fg=colour255,bg=colour27,bold] #I: #W #[default]"
if-shell "test -f ~/.tmux.conf.local" "source-file ~/.tmux.conf.local"