130 lines
4.1 KiB
Bash
130 lines
4.1 KiB
Bash
# 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+:#272e33,bg:#272e33,spinner:#a7c080,hl:#a7c080 \
|
|
--color=fg:#d3c6aa,header:#a7c080,info:#a7c080,pointer:#a7c080 \
|
|
--color=marker:#a7c080,fg+:#d3c6aa,prompt:#e67e80,hl+:#a7c080"
|
|
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=#d3c6aa,bg=#374145"
|
|
set -g status-right-style "none"
|
|
set -g pane-active-border-style "fg=#a7c080"
|
|
set -g status-style "none,bg=#272e33"
|
|
set -g message-style "fg=#d3c6aa,bg=#374145"
|
|
set -g pane-border-style "fg=#374145"
|
|
set -g status-right-length "100"
|
|
set -g status-left-length "100"
|
|
set-window-option -g window-status-activity-style "none,fg=#a7c080,bg=#272e33"
|
|
set-window-option -g window-status-separator ""
|
|
set-window-option -g window-status-style "none,fg=#d3c6aa,bg=#272e33"
|
|
set -g status-left "#[fg=#272e33,bg=#a7c080] #S #[fg=#a7c080,bg=#272e33,nobold,nounderscore,noitalics]"
|
|
set -g status-right ""
|
|
set-window-option -g window-status-format "#[fg=#272e33,bg=#272e33,nobold,nounderscore,noitalics]#[default] #I #W #[fg=#272e33,bg=#272e33,nobold,nounderscore,noitalics]"
|
|
set-window-option -g window-status-current-format "#[fg=#272e33,bg=#374145,nobold,nounderscore,noitalics]#[fg=#d3c6aa,bg=#374145] #I #W #[fg=#374145,bg=#272e33,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"
|