GNU Screen の設定あれこれ
リモートで接続する時に限らず、ローカルで作業する時でも便利なGNU Screen。
自分なりの設定を入れる事でさらに使いやすく作業効率が上がる。
かっこ良くできれば、厨二病パワー炸裂で毎日ハッピーw
Fedora18のyumコマンドでインストールされたscreenを使うよ。
上側に作業用のメインウィンドウ、下にコマンド用(左)とtopコマンド結果用(右)の3つに画面を分割する。
左右に画面分割するので、確か4.1以降でないと正しく表示できない設定。
早速~/.screenrcの内容
escape ^Tt hardstatus alwayslastline "%{r wm}%01=%H >> %{+b kM} %`%-w%{ wb} %n %t%{-}%+w %-040=%{-b wm}| %l | %Y/%m/%d %C %A" caption string '%?%F%{=b cW}%:%{= Kk}%?%2n%f%07=%t%=' term xterm-256color # Ctrl-t y でウィンドウ制御モード(仮)に移行する # Escキーが入力されるまで継続する bind y eval 'echo "Operate Window"' 'command -c operate' bind -c operate j eval 'focus down' 'command -c operate' bind -c operate k eval 'focus up' 'command -c operate' bind -c operate h eval 'focus left' 'command -c operate' bind -c operate l eval 'focus right' 'command -c operate' bind -c operate t eval 'focus top' 'command -c operate' bind -c operate + eval 'resize -v +1' 'command -c operate' bind -c operate - eval 'resize -v -1' 'command -c operate' bind -c operate > eval 'resize -h +1' 'command -c operate' bind -c operate < eval 'resize -h -1' 'command -c operate' bind -c operate = eval 'resize -h =' 'command -c operate' # Window間の行き来はCtrl-tと以下のキーの組み合わせで簡単に # Vimと同じキーバインド bind j eval 'focus down' bind k eval 'focus up' bind h eval 'focus left' bind l eval 'focus right' bind > eval 'resize -h +1' bind < eval 'resize -h -1' # Create window screen 0 screen 1 screen -t status 2 nice top #3番目はtopコマンド結果を表示 # Create layout layout new 0:layout0:horizontal # レイヤーを上下に分解 layout select 0 split # 下側 focus down resize -v 12 #高さ指定 split -v #左右に分割 select 1 #screen1を表示 title 'command line' # 下右側 focus right resize -h 80 select 2 #screen2を表示 title 'status' # 上側をアクティブにしてscreen0を表示 focus up select 0 title 'workspace'
実は最近tmuxに浮気した。個の記事をかなり前に下書き保存したまま放置してたのを発見したので浮気後にアップする。
キミとは短いような長いような付き合いだったが、今までありがとう。(何事
てことで、もうScreen使っていないので設定ファイルが正しいか確認してない。
まぁ今まで使ってたファイルからのコピペだろうから大丈夫なはずだ。(ずいぶん前に書き込んだから記憶が曖昧)