-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
117 lines (86 loc) · 4.05 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
# default shell
if-shell "test expr 'OSTYPE' : 'darwin.*' > /dev/null" "set-option -g default-shell /opt/local/bin/zsh"
if-shell "test expr 'OSTYPE' : 'linux*' > /dev/null" "set-option -g default-shell /bin/bash"
# ステータスバーをトップに配置する
set-option -g status-position top
# 左右のステータスバーの長さを決定する
set-option -g status-left-length 90
set-option -g status-right-length 90
# ステータスバーを1秒毎に描画し直す
set-option -g status-interval 1
# センタライズ(主にウィンドウ番号など)
set-option -g status-justify centre
# Prefix+v でコピーモード開始
bind-key v copy-mode \; display "Copy mode!"
# bind-key -t vi-copy v begin-selection
# vim <=> tmux 間でクリップボード利用を可能にする
if-shell "test expr 'OSTYPE' : 'darwin*' > /dev/null" "set-option -g default-command 'which reattach-to-user-namespace > /dev/null && reattach-to-user-namespace -l $SHELL || $SHELL'"
if-shell "test expr 'OSTYPE' : 'darwin*' > /dev/null" "set-option -g default-command '/opt/local/bin/reattach-to-user-namespace $SHELL'"
# Prefix+Enter/y でコピー
# bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
# Prefix+p でペースト
# クリップボードにも保存されているので Cmd-v でもペースト可能
bind-key p paste-buffer
# ステータスバーの色
set -g status-fg colour253
set -g status-bg colour237
# 非アクティブなウィンドウの色
set-window-option -g window-status-fg default
set-window-option -g window-status-bg default
# アクティブなウィンドウの色
set-window-option -g window-status-current-fg colour16
set-window-option -g window-status-current-bg colour178
# ステータスバー左隅に出すもの
set -g status-left ''
DOTFILES="$HOME/.dotfiles"
# ステータスバー右隅に出すもの
set -g status-right '#($DOTFILES/tmux-wifi-os-x/wifi-signal-strength) %m/%d %H:%M:%S#[default]'
set allow-rename off
# window-status のフォーマットを指定する。
#set-window-option -g window-status-format " #I: #W @ #h "
#set-window-option -g window-status-format " #I: #{pane_current_path} @ #h "
set-window-option -g window-status-format ' #I: #(echo "#{pane_current_path}" | rev | cut -d'/' -f-2 | rev) @ #h '
# カレントウィンドウの window-status のフォーマットを指定する
set-window-option -g window-status-current-format "#[fg=colour255,bg=colour27,bold] #I: #W #[default]"
# scroll like vim
set-window-option -g mode-keys vi
# pane-active-border
set -g pane-active-border-fg black
set -g pane-active-border-bg cyan
# history
set -g history-limit 10000
# map Vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# ウィンドウのインデックスを1から始める
set -g base-index 1
# ペインのインデックスを1から始める
setw -g pane-base-index 1
# split windows
bind-key v split-window -h -c '#{pane_current_path}'
bind-key b split-window -c '#{pane_current_path}'
# auto window rename
set-window-option -g automatic-rename
# reload config
bind r source-file $HOME/.tmux.conf ; display-message "Reload Config!!"
# term
set-option -g default-terminal "screen-256color"
set-option -g renumber-windows on
bind -n C-l send-keys -R \; send-keys C-l \; clear-history
set-option -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'"
setw -g monitor-activity on
set -g visual-activity on
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-ressurect'
set-option -g @plugin 'knakayama/tmux-fuc'
set-option -g @plugin 'knakayama/tmux-man'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '$HOME/.tmux/plugins/tpm/tpm'