This repository has been archived by the owner on Jul 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
executable file
·91 lines (71 loc) · 3.5 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
# プレフィックスキーを`Ctrle-g`に変更
set-option -g prefix C-g
unbind-key C-b
bind-key C-g send-prefix
# ペインのインデックスを1から始める
setw -g pane-base-index 1
#マウス操作を有効にする
set-option -g mouse on
# スクロールアップするとコピーモードに入る
bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
# tmux_copy to win32yank
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "win32yank.exe -i"
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "win32yank.exe -i"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "win32yank.exe -i"
unbind-key -T prefix v
bind-key ] run "win32yank.exe -o | tmux load-buffer - && tmux paste-buffer"
bind-key p run "win32yank.exe -o | tmux load-buffer - && tmux paste-buffer"
# 最後までスクロールダウンするとコピーモードを抜ける
bind-key -n WheelDownPane select-pane -t= \; send-keys -M
# Use vim keybindings in copy mode
setw -g mode-keys vi
# shellを変更
# if-shell "test -f /usr/bin/fish" "set-option -g default-shell '/usr/bin/fish'"
# if-shell "test -f /usr/bin/fish" "set -g default-command '/usr/bin/fish'"
# # Mac OS X pasteboardを使用できるようにする
# set-option -g default-command "reattach-to-user-namespace -l fish"
# 'v' で選択を始める
#bind-key -T copy-mode-vi v send-keys -X begin-selection
#bind-key -T copy-mode-vi [ send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# `Enter` でもcopy-pipeを使う
#unbind -T copy-mode-vi Enter
#bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# ']' でpbpasteを使う
#bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# Vimと同じキーバインドでペイン移動できるように
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -r H resize-pane -L 2
bind-key -r J resize-pane -D 2
bind-key -r K resize-pane -U 2
bind-key -r L resize-pane -R 2
# ウィンドウ境界線の設定
set -g pane-active-border-style 'fg=default,bg=colour249'
# 左右のステータスバーの長さを決定する
set-option -g status-left-length 90
set-option -g status-right-length 120
# 最左に表示
set-option -g status-left '#[bold]#{?client_prefix,#[fg=white]#[bg=red] [COMMAND] ,#[fg=white]#[bg=blue] [NORMAL] }#[default] '
# 最右に表示
# set-option -g status-right '#(~/bin/loadavg) #(~/bin/memory) #(~/bin/wifi) #(~/bin/battery --tmux) [%Y-%m-%d(%a) %H:%M:%S]'
set-option -g status-right '[%Y-%m-%d(%a) %H:%M:%S]'
# window-status のフォーマット
set-window-option -g window-status-format "#I:#W "
set-window-option -g window-status-current-format "#[fg=colour15,bg=colour235,bold]#I:#W#[default] "
# ステータスバーを1秒毎に描画し直す
set-option -g status-interval 1
set-option -g status-justify left
set -g default-terminal "screen-256color"
set -g terminal-overrides 'xterm:colors=256'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Other examples:
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-processes 'irb pry "~rails server" "~rails console"'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'