-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.tmux.conf
More file actions
86 lines (66 loc) · 2.51 KB
/
.tmux.conf
File metadata and controls
86 lines (66 loc) · 2.51 KB
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
# tmuxを256色表示できるようにする
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# prefixキーをC-qに変更
set -g prefix C-q
set -g prefix2 C-b
# C-bのキーバインドを解除
unbind C-b
# ステータスバー
set -g status-style bg=colour235,fg=colour136
set -g status-left "#[fg=colour46,bold] #S "
set -g status-right "#[fg=colour46]#H "
set -g status-left-length 30
setw -g window-status-current-style fg=colour166,bold
# vimのキーバインドでペインを移動する
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# vimのキーバインドでペインをリサイズする
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# | でペインを縦分割する
bind | split-window -h -c "#{pane_current_path}"
# - でペインを縦分割する
bind - split-window -v -c "#{pane_current_path}"
# 番号基準値を変更
set -g pane-base-index 1
set -g base-index 1
set -g renumber-windows on
# マウス操作を有効にする
set -g mouse on
# コピーモードに入る(通常ペインでホイール時)
bind-key -n WheelUpPane if-shell -Ft= "#{pane_in_mode}" "" "copy-mode -e"
# コピーモード内のスクロール量を1行に
bind -T copy-mode-vi WheelUpPane send-keys -N 2 -X scroll-up
bind -T copy-mode-vi WheelDownPane send-keys -N 2 -X scroll-down
# コピーモードを設定する
# コピーモードでvimキーバインドを使う
if-shell "uname | grep -q Darwin" \
'bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"' \
'bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard"'
# 'v' で選択を始める
bind -T copy-mode-vi v send -X begin-selection
# 'V' で行選択
bind -T copy-mode-vi V send -X select-line
# 'C-v' で矩形選択
bind -T copy-mode-vi C-v send -X rectangle-toggle
# 'y' でヤンク
if-shell "uname | grep -q Darwin" \
'bind -T copy-mode-vi y send -X copy-pipe-and-cancel "pbcopy"' \
'bind -T copy-mode-vi y send -X copy-pipe-and-cancel "xclip -selection clipboard"'
# 'Y' で行ヤンク
bind -T copy-mode-vi Y send -X copy-line
# 'C-p'でペースト
bind-key C-p paste-buffer
# Escの遅延を除去(vim使いに必須)
set -sg escape-time 0
# 設定リロード
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# vimモード
set -g mode-keys vi
# ウィンドウサイズを最新に
set -g window-size latest