-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
105 lines (84 loc) · 3.45 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
# ---------- #
# Prefix変更 #
# ---------- #
set -g prefix C-s
bind-key C-s send-prefix
unbind-key C-b
# 設定ファイル再読み込み
bind r source-file ~/.tmux.conf \; display-message "Reloaded!"
# ----------------- #
# defaultの挙動変更 #
# ----------------- #
# 開くpane / windowをcurrent pathにする
bind c new-window -c "#{pane_current_path}"
bind % split-window -hc "#{pane_current_path}"
bind '"' split-window -vc "#{pane_current_path}"
# vim用
set -s escape-time 20
# -------------------- #
# ウィンドウの振る舞い #
# -------------------- #
## ウィンドウ番号1から開始する
set -g base-index 1
# マウスでスクロールできるようにする
set -g mouse on
# ウィンドウ(タブ)を閉じた時、ウインドウ番号を付番をしなおす
set -g renumber-windows on
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n 'C-\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# ------------ #
# コピーモード #
# ------------ #
# use vi mode
set -g mode-keys vi
# Setup 'v' to begin selection as in Vim
# set -g default-command "reattach-to-user-namespace -l $SHELL"
unbind -T copy-mode-vi Enter
bind -T copy-mode-vi v send -X begin-selection
# bind -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# bind -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind -T copy-mode-vi y send -X copy-and-cancel
bind -T copy-mode-vi Enter send -X copy-and-cancel
# ---------------------- #
# ステータスバーの見た目 #
# ---------------------- #
# 色コード: http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
# 256色サポート
set -g default-terminal "xterm"
# ステータスバーの色
set -g status-style fg=colour253,bg=colour237
# 非アクティブなウィンドウの色
set-window-option -g window-status-style fg=default,bg=default
# アクティブなウィンドウの色
set-window-option -g window-status-current-format "#[fg=colour255,bg=colour241,bold] #I: #W #[default]"
# ステータスバーの位置
set -g status-position top # bottom
# ステータスバー左隅に出すもの
set -g status-left "#{?client_prefix,#[reverse],}#[fg=green][#S:#I.#P]#[fg=yellow][#(whoami)] "
set -g status-left-length 50
# ステータスバー右隅に出すもの
set -g status-right "#{?client_prefix,#[reverse],}#(cat ~/.gomodoro.tmux)#[fg=green]#{battery_icon} #{battery_percentage} #{battery_remain} | %#[fg=cyan][%Y/%h/%d %H:%M]"
set -g status-interval 1
# --------- #
# powerline #
# --------- #
# source ~/.anyenv/envs/pyenv/versions/2.7.11/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
# clipboard
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-sensible'
# mouse
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
# battery
set -g @plugin 'tmux-plugins/tmux-battery'
# open url, file
set -g @plugin 'tmux-plugins/tmux-open'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'