Skip to content

Instantly share code, notes, and snippets.

@t3tra-dev
Created January 24, 2025 06:41
Show Gist options
  • Save t3tra-dev/fc36bc89b9a50208ddf8d395b27120da to your computer and use it in GitHub Desktop.
Save t3tra-dev/fc36bc89b9a50208ddf8d395b27120da to your computer and use it in GitHub Desktop.
# tmux起動時のシェルをzshにする
set-option -g default-shell /bin/zsh
# tmuxを256色表示できるようにする
set-option -g default-terminal screen-256color
set -g terminal-overrides 'xterm:colors=256'
# ステータスバーをトップに配置する
set-option -g status-position top
# 左右のステータスバーの長さを決定する
set-option -g status-left-length 90
set-option -g status-right-length 90
# #P => ペイン番号
# 最左に表示
set-option -g status-left '#H:[#P]'
# 現在時刻
# 最右に表示
set-option -g status-right '[%Y-%m-%d(%a) %H:%M%S]'
# ステータスバーを1秒毎に描画し直す
set-option -g status-interval 1
# センタライズ(主にウィンドウ番号など)
set-option -g status-justify centre
# ステータスバーの色を設定する
set-option -g status-bg "colour238"
# status line の文字色を指定する。
set-option -g status-fg "colour255"
# | でペインを縦分割する
bind | split-window -h
# - でペインを縦分割する
bind - split-window -v
# 番号基準値を変更
set-option -g base-index 1
# マウス操作を有効にする
set-option -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
@verazza
Copy link

verazza commented Feb 1, 2025

いつもお世話になってます。

# ペイン追加時に現在のディレクトリを引き継ぐ設定
bind-key c new-window -c "#{pane_current_path}"
bind-key % split-window -h -c "#{pane_current_path}"
bind-key '"' split-window -v -c "#{pane_current_path}"

これ追加すると、

  1. tmuxで新しいウィンドウを開く: C-b c
  2. tmuxで水平にペインを分割する: C-b %
  3. tmuxで垂直にペインを分割する: C-b "

このときに、現在選択中のパスを引き継げるよ!

@t3tra-dev
Copy link
Author

@bella2391 確かに!ありがとう

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment