dotfiles/.tmux.conf

131 lines
4.1 KiB
Plaintext

# prefixキーをM-aに変更する
set -g prefix M-a
# M-bのキーバインドを解除する
unbind M-b
# マウス操作を有効にする
set-option -g mouse on
# デフォルトシェルの設定
set-option -g default-shell /bin/zsh
set-option -g default-command /bin/zsh
# キーストロークのディレイを減らす
set -s escape-time 10
# ウィンドウのインデックスを1から始める
set -g base-index 1
# ペインのインデックスを1から始める
set-window-option -g pane-base-index 1
# 設定ファイルをリロードする
bind-key r source-file ~/.tmux.conf \; display "Reloaded."
# M-a*2でtmux内のプログラムにM-aを送る
bind-key M-a send-prefix
# セッション操作
bind -n M-C new-session
bind -n M-L switch-client -n
bind -n M-H switch-client -p
## tmux-fzf
TMUX_FZF_LAUNCH_KEY="a"
TMUX_FZF_OPTIONS="-p 20% --preview 'echo {}' --preview-window=border-sharp,hidden --bind '?:toggle-preview' --multi --ansi --no-separator --no-scrollbar --reverse --border=none \
--color=bg+:#1c1e26,bg:#1c1e26,spinner:#ee64ac,hl:#e95678 \
--color=fg:#d5d8da,header:#e95678,info:#e95678,pointer:#ee64ac \
--color=marker:#ee64ac,fg+:#d5d8da,prompt:#e95678,hl+:#e95678"
TMUX_FZF_PREVIEW=0
# ウインドウ操作
bind-key -n M-s split-window -v -c "#{pane_current_path}"
bind-key -n M-v split-window -h -c "#{pane_current_path}"
bind-key -n M-Left select-pane -L
bind-key -n M-Right select-pane -R
bind-key -n M-Up select-pane -U
bind-key -n M-Down select-pane -D
bind-key -n M-w new-window
bind-key -n M-e popup
bind-key -n M-Tab select-window -t :+
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
bind-key -n M-h select-pane -L
bind-key -n M-l select-pane -R
bind-key -n M-j select-pane -D
bind-key -n M-k select-pane -U
bind-key -n M-q kill-pane
bind-key q kill-window
# コピーモード
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -bi"
bind-key -T copy-mode-vi Y send-keys -X copy-line "xsel -bi"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xsel -bi"
bind-key Space copy-mode
bind-key p paste-buffer
# Vimのキーバインドでペインをリサイズする
bind-key -r H resize-pane -L 3
bind-key -r J resize-pane -D 3
bind-key -r K resize-pane -U 3
bind-key -r L resize-pane -R 3
# 256色端末を使用する
set -g default-terminal "tmux-256color"
set-option -sa terminal-overrides ",xterm-256color:RGB"
set-option -ga terminal-overrides ",$TERM:Tc"
# ペインの枠線
set -g pane-border-lines single
# ステータスバーを設定する
set-option -g status-position "top"
set -g status-justify "left"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=#c5cdd9,bg=#414550"
set -g status-right-style "none"
set -g pane-active-border-style "fg=#a0c980"
set -g status-style "none,bg=#33353f"
set -g message-style "fg=#c5cdd9,bg=#414550"
set -g pane-border-style "fg=#414550"
set -g status-right-length "100"
set -g status-left-length "100"
set-window-option -g window-status-activity-style "none,fg=#a0c980,bg=#33353f"
set-window-option -g window-status-separator ""
set-window-option -g window-status-style "none,fg=#c5cdd9,bg=#33353f"
set -g status-left "#[fg=#2c2e34,bg=#a0c980] #S #[fg=#a0c980,bg=#33353f,nobold,nounderscore,noitalics]"
set -g status-right ""
set-window-option -g window-status-format "#[fg=#33353f,bg=#33353f,nobold,nounderscore,noitalics]#[default] #I #W #[fg=#33353f,bg=#33353f,nobold,nounderscore,noitalics]"
set-window-option -g window-status-current-format "#[fg=#33353f,bg=#414550,nobold,nounderscore,noitalics]#[fg=#c5cdd9,bg=#414550] #I #W #[fg=#414550,bg=#33353f,nobold,nounderscore,noitalics]"
## リフレッシュの間隔を設定する
set -g status-interval 1
## フォーカスイベント
set -g focus-events on
## ヴィジュアルノーティフィケーションを有効にする
set-window-option -g monitor-activity on
set -g visual-activity on
## TPM
set -g @plugin "sainnhe/tmux-fzf"
run -b "/usr/share/tmux-plugin-manager/tpm"