タグ別アーカイブ: tmux

tmuxのちょと便利な設定

タグ: , | 投稿日: 投稿者:

nor です。

今日は CUI LOVE な人間必須の「tmux」のちょと便利な設定を紹介します。
※ tmux? というかたは、ググってください。

tmux (or screen) を活用しているかたは、C-t [1-9] ですいすいウィンドウを移動しているに違いない今日この頃ですが、screen ですとウィンドウ数が 10 を超えた場合、ウィンドウ移動が極端にめんどくさくなります。
ええ、引越しの梱包くらいめんどくさいです。

そこで、登場! 素敵な tmux !

なんと、↓の設定を$HOME/.tmux.conf に追加するだけで、C-t space⏎ [ウィンドウ番号] で移動できちゃうんです!
すごく楽なんです。

 unbind space
bind space command-prompt "select-window -t '%%'"

↑の設定を保存したら、tmux 起動

tmux

C-t space !!!

tmux

ウィンドウ名 11 を入力

tmux

キタコレ!

tmux

一気にウィンドウ11に移動です!(まあ 1 からなんで C-t p でも移動できるんですが……)

これであなたも、tmux に夢中ですね!

ちなみに、nor の .tmux.conf は↓な感じです。

unbind C-b
set -g prefix C-t
bind C-t last-window

set-window-option -g utf8 on

set-option -g base-index 1
set-option -g default-shell /bin/zsh
set-option -g status-fg white
set-option -g status-bg colour18
set-option -g status-interval 5

setw -g window-status-current-fg red
setw -g window-status-current-bg colour18
setw -g window-status-current-attr bold
setw -g mode-keys vi

set -g pane-active-border-fg black
set -g pane-active-border-bg cyan

bind s split-window -v
bind v split-window -h
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

unbind space
bind space command-prompt "select-window -t '%%'"

unbind r
bind r source-file ~/.tmux.conf