Skip to content

Instantly share code, notes, and snippets.

@ohtsuchi
Last active July 11, 2019 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ohtsuchi/6100e906344c2864edffc3e9b5c0ce63 to your computer and use it in GitHub Desktop.
Save ohtsuchi/6100e906344c2864edffc3e9b5c0ce63 to your computer and use it in GitHub Desktop.

conf

reload

tmux source ~/.tmux.conf

Command mode

Prefix :

synchronize-panes

:setw synchronize-panes on
:setw synchronize-panes off

Copy mode

  • Prefix [
  • コピーの始点
    • <Space>
  • 終点
    • <Enter>
  • 貼り付け
    • Prefix ]

Buffer の選択

  • Prefix =

Session

起動

tmux new -s <session名>

Session の確認

tmux ls
  • 現在起動中のセッションに接続されているクライアントを確認
tmux lsc

detach

Prefix d

attach

  • tmux attach または tmux a
    • -t [target-session]
      • 複数のtmuxセッションを起動している場合
tmux a -t <session名>

Session の削除

  • tmux kill-session
    • -t [target-session]
      • 指定しない場合は直近でアタッチしていたセッションが削除
tmux kill-session
  • 全てのセッションを削除
tmux kill-server

セッションの切り替え

Prefix )
Prefix (

セッション名を変更

Prefix $
  • tmux rename -t<古い名前> <新しい名前>
tmux rename -t0 hoge-session

Window

  • Create
Prefix c 
  • 移動
Prefix n
Prefix p
Prefix 番号
  • ウィンドウ名変更
Prefix ,

Swapping windows

Prefix <
Prefix >

ウィンドウ一覧の表示

Prefix w

ウィンドウ名検索

Prefix f

ウィンドウの削除

Prefix &

Pane

移動

Prefix o
Prefix q  # 数字表示 -> 選択
Prefix ;  # 直前のペイン

Navigation

  • prefix + h(j,k,l) and prefix + C-h(j,k,l)

Resizing panes

  • prefix + shift + h(j,k,l)

Splitting panes

Prefix |
Prefix -

Pane 入れ替え

Prefix {
Prefix }

配置を回転

Prefix <SPACE>

ローテート

Prefix C-o

Pane 最大化

Prefix z

Pane を Window から外す

  • 現在選択している Pane が新しく作られた Window へ移動
Prefix !

Pane 強制終了

  • その Pane で動作中のプログラムも一緒に終了
Prefix x
  • window
    • Swapping windows
  • pane
    • Navigation
    • Resizing panes
    • Splitting panes
  • ハイライトされている状態で
    • y
      • clipboard にコピー
  • #{prefix_highlight}
  • #{cpu_percentage} #{cpu_bg_color} #{cpu_icon}
# 右パネルを設定
set -g status-right '#{prefix_highlight} | %Y-%m-%d(%a) %H:%M | CPU:#{cpu_percentage} #{cpu_bg_color} #{cpu_icon}'
  • In tmux copy mode:
    • o
      • システムのプログラムで開く。Macは open コマンド
    • <C-o>
      • $EDITOR で開く

Dependencies

brew install urlview
  • u
    • listing all urls on bottom pane

Dependencies

brew install fpp

key bind

  • tmux: f -> F に変更
set -g @fpp-key 'F'
  • [c] command mode
    • $F
      • (例) cat $F | wc -l
  • prefix + Ctrl-s - save
  • prefix + Ctrl-r - restore

Automatic restore

set -g @continuum-restore 'on'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment