LoginSignup
4
5

More than 1 year has passed since last update.

めんどくせーからtmux.confそのまま晒す

Last updated at Posted at 2018-12-05

見た目のカスタマイズは airline でアガってる
https://github.com/vim-airline/vim-airline
https://github.com/edkolev/tmuxline.vim

# vim: set ff=unix tabstop=4 shiftwidth=0 softtabstop=-1 noexpandtab fileencoding=utf-8 fileformat=unix filetype=tmux :
#https://gist.github.com/kotashiratsuka/8b4a17429053f79f75566fadb8bf1d95

# Screen Compatible
unbind C-b
set -g prefix C-z

# prefix-keyの有効時間
#set -g repeat-time 1000

# 256色端末を使用する
set -g default-terminal "xterm-256color"

# viのキーバインドを使用する
setw -g mode-keys vi

# address vim mode switching delay (http://superuser.com/a/252717/65504)
set -sg escape-time 0

# tmux messages are displayed for 4 seconds
set -g display-time 4000

# Scrollback Limit
set -g history-limit 50000

#マウスデフォルトはOFF
#setw -g mouse on

# ウィンドウ/ペインの開始番号を1からにする(デフォルトは0から)
set -g base-index 1
setw -g pane-base-index 1
#set -g renumber-windows on

# status
setw -g monitor-activity on
set -g status-left ''
set -g status-right '#h'
set -g pane-active-border-style "fg=colour46"
setw -g window-status-current-style "bg=black,fg=colour46"
setw -g window-status-activity-style none
#set -g pane-border-status bottom
#set -g status-justify centre

#C-ZZでサスペンド
bind ^z send-prefix
bind ^a last-window
bind ^c new-window
bind ^D detach-client
bind r command-prompt -I "#W" "rename-window -- '%%'"
bind ^r source-file ~/.tmux.conf \; display "Reload."
bind l choose-tree -Zw
bind k confirm-before -p "kill-window #W? (y/n)" kill-window

#Scroll buffer kill
#bind -n C-l send-keys C-l \; send-keys -R \; clear-history

#Broadcast Imput
bind i set-window-option synchronize-panes

#マウスOn/Off
bind m set-option -g mouse on \; display 'Mouse: ON'
bind M set-option -g mouse off \; display 'Mouse: OFF'

# Keybind ウィンド分割
bind | split-window -h               #縦分割
bind - split-window -v               #横分割
bind + break-pane                    #分割解除
bind = select-layout even-horizontal #リサイズ

# Window <-> Pane
bind j command-prompt -p "join pane from:"  "join-pane -s '%%'"
bind s command-prompt -p "send pane to:"  "join-pane -t '%%'"

# Keybind ウィンド切り替え
bind -r ^p select-window -t :-
bind -r ^n select-window -t :+

# ペイン切り替え(Vim風)
bind -r ^j select-pane -D #down
bind -r ^k select-pane -U #up
bind -r ^h select-pane -L #left
bind -r ^l select-pane -R #right

# カーソルキーでペインの大きさ変更
bind -r Up    resize-pane -U 5
bind -r Down  resize-pane -D 5
bind -r Left  resize-pane -L 5
bind -r Right resize-pane -R 5

# Vimを操作してない時にMeta + HJKLを有効化、Vimに捕まったら<C-z>hjklで脱出
bind -n M-h if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys M-h" "select-pane -L"
bind -n M-j if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys M-j" "select-pane -D"
bind -n M-k if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys M-k" "select-pane -U"
bind -n M-l if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys M-l" "select-pane -R"

# Keybind セッション
bind A switch-client -l
bind C new-session
bind D choose-client
bind P switch-client -p
bind N switch-client -n
bind L choose-session
bind K confirm-before -p "kill-session? #S (y/n)" kill-session

# commmand の移動はemacsキーバインド
set -g status-keys emacs

#set -g @plugin 'tmux-plugins/tpm'
#set -g @plugin 'tmux-plugins/tmux-resurrect'
#set -g @plugin 'tmux-plugins/tmux-continuum'

#if "test ! -d ~/.tmux/plugins/tpm" \
#   "run 'mkdir -p ~/.tmux/plugins/tpm && git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
#run -b "~/.tmux/plugins/tpm/tpm"

if-shell "test -f ~/.tmux-extra.conf" "source .tmux-extra.conf"
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5