-
Notifications
You must be signed in to change notification settings - Fork 2
/
.tmux.conf
77 lines (76 loc) · 4.2 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
# ----------------------------------------------------------------------------
# prefix
# ----------------------------------------------------------------------------
set -g prefix 'C-q' # C-q を prefix に変更
unbind-key 'C-b' # C-b (default prefix) を解除
# ----------------------------------------------------------------------------
# common
# ----------------------------------------------------------------------------
set -g history-limit 20000 # ヒストリの上限
set -g base-index 1 # windowsの番号を1始まりにする
set -g pane-base-index 1 # paneの番号を1始まりにする
set -g mouse on # マウスを使う
set -g default-terminal "screen-256color" # ターミナル
# ----------------------------------------------------------------------------
# 256 Color
# ----------------------------------------------------------------------------
# https://sota1235.hatenablog.com/entry/2015/07/09/203000
# set -g terminal-overrides 'xterm:colors=256'
# ----------------------------------------------------------------------------
# True Color
# ----------------------------------------------------------------------------
# https://qiita.com/yami_beta/items/ef535d3458addd2e8fbb
set -ga terminal-overrides ",*256col*:Tc"
# ----------------------------------------------------------------------------
# ACS ruled line
# ----------------------------------------------------------------------------
# https://qiita.com/yanma/items/2644e6db6f3bcf249690
set -ga terminal-overrides ",*:U8=0"
# ----------------------------------------------------------------------------
# OSC52 (clipboard)
# ----------------------------------------------------------------------------
# https://web.archive.org/web/20170824080401/http://doda.b.osdn.me/2011/12/15/tmux-set-clipboard
# set -ga terminal-overrides ",screen-256color:Ms=\\E]52;%p1%s;%p2%s\\7"
# ----------------------------------------------------------------------------
# vi key feeling
# ----------------------------------------------------------------------------
set -g mode-keys vi # コピーモードでhjklで移動
bind-key 'h' select-pane -L # h で左paneへ移動
bind-key 'j' select-pane -D # j で下paneへ移動
bind-key 'k' select-pane -U # k で上paneへ移動
bind-key 'l' select-pane -R # l で右paneへ移動
bind-key 'C-h' select-pane -L # C-h で左paneへ移動
bind-key 'C-j' select-pane -D # C-j で下paneへ移動
bind-key 'C-k' select-pane -U # C-k で上paneへ移動
bind-key 'C-l' select-pane -R # C-l で右paneへ移動
unbind-key '%'
bind-key '-' split-window -v # - でpaneを横に分割
unbind-key '"'
bind-key '|' split-window -h # | でpaneを縦に分割
# ----------------------------------------------------------------------------
# reload config
# ----------------------------------------------------------------------------
bind-key 'r' source-file ~/.tmux.conf # C-q r で設定ファイルの再読込
# ----------------------------------------------------------------------------
# クリップボード共有 (using xsel)
# ----------------------------------------------------------------------------
# http://d.hatena.ne.jp/tmatsuu/20111220/1324399472
bind-key 'c' run "tmux save-buffer - | xsel --clipboard --input"
bind-key 'v' run "xsel --clipboard --output | tmux load-buffer - && tmux paste-buffer"
# ----------------------------------------------------------------------------
# keyboard shortcut
# ----------------------------------------------------------------------------
bind m command-prompt "split-window 'exec man %%'" # 別windowでmanを開く
# ----------------------------------------------------------------------------
# status line
# ----------------------------------------------------------------------------
set -g status-position top # ステータスバーを上に表示
set -g status-interval 1 # 1秒間隔で更新する
set -g status-left ""
set -g status-right "%Y-%m-%d %H:%M:%S #h [#S]"
# ----------------------------------------------------------------------------
# border line
# ----------------------------------------------------------------------------
# https://qiita.com/arks22/items/db8eb6a14223ce29219a
set -g pane-border-status bottom
set -g pane-border-format "{#[bold]###P #T#[default]}"