Monday, August 25, 2014

tmux shortcuts

got the nice tmux listing from http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/

list sessions
    tmux ls
    tmux list-sessions
start a new session
    tmux
    tmux new
    tmux new-session
re-attach a detached session
    tmux attach
    tmux attach-session
re-attach an attached session (detaching it from elsewhere)
    tmux attach -d
    tmux attach-session -d
re-attach an attached session (keeping it attached elsewhere)
    tmux attach
    tmux attach-session


    Ctrl-b c Create new window
    Ctrl-b d Detach current client (:detach)
    Ctrl-b l Move to previously selected window
    Ctrl-b n Move to the next window
    Ctrl-b p Move to the previous window
    Ctrl-b & Kill the current window
    Ctrl-b , Rename the current window (:rename-window)
    Ctrl-b t SHow time
    Ctrl-b ? List all keybindings

    Ctrl-b % Split the current window into two vertical panes
    Ctrl-b " Split the current window into two horizontal panes
    Ctrl-b q Show pane numbers (used to switch between panes)
    Ctrl-b ! close other panes except the current one
    Ctrl-b b Ctrl-b o swap location of panes
    Ctrl-b o (Goto next pane)
    Ctrl-b q (Show pane numbers, when the numbers show up type the key to goto that pane)
    Ctrl-b { (Move the current pane left)
    Ctrl-b } (Move the current pane right)

    Ctrl-b n (Move to the next window)
    Ctrl-b p (Move to the previous window)
    Ctrl-b l (Move to the previously selected window)
    Ctrl-b w (List all windows / window numbers)
    Ctrl-b  (Move to the specified window number, the default bindings are from 0 – 9)

    Ctrl-b [ start copy mode (q to quit copy mode)
    Ctrl-b PageUp start copy-mode directly on the previous page

    Ctrl-b : (execute commands interactively)


    Ctrl-b % (Split the window vertically)
    Ctrl-b : split-window (Split window horizontally)
    Ctrl-b  (toggle through the different layouts: main-vertical, even-vertical, ...)


    move-window [ −d] [ −s src-window] [ −t dst-window]
    swap-window [ -d] [ -s src-window] [ -t dst-window]

    Ctrl-b : break-pane (take a pane and make it into its own window)

    Ctrl-b : resize-pane (By default it resizes the current pane down)
    Ctrl-b : resize-pane -U (Resizes the current pane upward)
    Ctrl-b : resize-pane -L (Resizes the current pane left)
    Ctrl-b : resize-pane -R (Resizes the current pane right)
    Ctrl-b : resize-pane 20 (Resizes the current pane down by 20 cells)
    Ctrl-b : resize-pane -U 20 (Resizes the current pane upward by 20 cells)
    Ctrl-b : resize-pane -L 20 (Resizes the current pane left by 20 cells)
    Ctrl-b : resize-pane -R 20 (Resizes the current pane right by 20 cells)
    Ctrl-b : resize-pane -t 2 20 (Resizes the pane with the id of 2 down by 20 cells)
    Ctrl-b : resize-pane -t -L 20 (Resizes the pane with the id of 2 left by 20 cells)
    ...


~/.tmux.conf

set-option -g prefix C-a
unbind %
bind | split-window -h
bind – split-window -v
bind-key C-b last-window (hit Ctrl-b twice)
set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=green]#H'
# Highlight active window
set-window-option -g window-status-current-bg red
set -g status-right '#[fg=yellow]#(uptime | cut -d “,” -f 2-)'

No comments: