Last active
June 2, 2021 16:59
-
-
Save kotashiratsuka/8b4a17429053f79f75566fadb8bf1d95 to your computer and use it in GitHub Desktop.
.tmux.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 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 | |
# 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" | |
# カーソルキーでペインの大きさ変更 | |
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 | |
# 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' | |
#set -g @plugin 'tmux-plugins/tmux-copycat' | |
#tmux-copycat | |
#Predefined searches | |
# | |
#prefix + ctrl-f - simple file search | |
#prefix + ctrl-g - jumping over git status files (best used after git status command) | |
#prefix + alt-h - jumping over SHA-1/SHA-256 hashes (best used after git log command) | |
#prefix + ctrl-u - url search (http, ftp and git urls) | |
#prefix + ctrl-d - number search (mnemonic d, as digit) | |
#prefix + alt-i - ip address search | |
#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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment