Skip to content

Instantly share code, notes, and snippets.

@rkmarvin
Forked from mloskot/cheat-tmux.markdown
Created September 27, 2022 08:52
Show Gist options
  • Select an option

  • Save rkmarvin/b97c832deaff1221ae07699e20381f2c to your computer and use it in GitHub Desktop.

Select an option

Save rkmarvin/b97c832deaff1221ae07699e20381f2c to your computer and use it in GitHub Desktop.

Revisions

  1. @mloskot mloskot revised this gist Dec 14, 2012. 1 changed file with 32 additions and 31 deletions.
    63 changes: 32 additions & 31 deletions cheat-tmux.markdown
    Original file line number Diff line number Diff line change
    @@ -4,48 +4,49 @@
    * Version: 7 (udpated by mloskot)

    ## Managing tmux sessions

    ```
    $ tmux # start tmux server
    $ tmux at # attach running sessions to a terminal
    $ tmux ls # list running tmux sessions
    $ exit # close tmux session
    ```

    ## Sharing sessions between terminals

    ```
    $ tmux new -s session_name # make new named session
    $ tmux at -t session_name # attach to exist session (allowing shared sessions)
    $ tmux kill-session -t session_name # kill named session
    ```

    ## Commands (used within a running tmux session):

    NOTE: All commands need to be prefixed with the action key. By default, this is ```CTRL-b```

    c - create new window
    n/p - move to next/previous window
    0-9 - move to window number 0-9
    l - move to previously selected window
    f - find window by name
    w - menu with all windows
    & - kill current window
    , - rename window

    % - split window, adding a vertical pane to the right
    " - split window, adding an horizontal pane below
    ?/? - move focus to left/right pane
    ?/? - move focus to upper/lower pane
    q - show pane numbers (used to switch between panes)
    o - switch to the next pane

    ! - Break current pane into new window
    x - Kill the current pane.
    d - detach the current client
    ? - list all keybindings

    [ - enter copy mode (then use emacs select/yank keys)
    * press CTRL-SPACE or CTRL-@ to start selecting text
    * move cursor to end of desired text
    * press ALT-w to copy selected text

    ] - paste copied text

    ? - show tmux key bindings

    * c - create new window
    * n/p - move to next/previous window
    * 0-9 - move to window number 0-9
    * l - move to previously selected window
    * f - find window by name
    * w - menu with all windows
    * & - kill current window
    * , - rename window
    * % - split window, adding a vertical pane to the right
    * " - split window, adding an horizontal pane below
    * q - show pane numbers (used to switch between panes)
    * o - switch to the next pane
    * ?/? - move focus to left/right pane
    * ?/? - move focus to upper/lower pane

    * ! - Break current pane into new window
    * x - Kill the current pane.
    * d - detach the current client
    * ? - list all keybindings

    * [ - enter copy mode (then use emacs select/yank keys)
    * press CTRL-SPACE or CTRL-@ to start selecting text
    * move cursor to end of desired text
    * press ALT-w to copy selected text
    * ] - paste copied text

    * ? - show tmux key bindings
  2. @mloskot mloskot created this gist Dec 14, 2012.
    51 changes: 51 additions & 0 deletions cheat-tmux.markdown
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@
    # $ cheat tmux

    * Source: http://cheat.errtheblog.com/s/tmux
    * Version: 7 (udpated by mloskot)

    ## Managing tmux sessions

    $ tmux # start tmux server
    $ tmux at # attach running sessions to a terminal
    $ tmux ls # list running tmux sessions
    $ exit # close tmux session

    ## Sharing sessions between terminals

    $ tmux new -s session_name # make new named session
    $ tmux at -t session_name # attach to exist session (allowing shared sessions)
    $ tmux kill-session -t session_name # kill named session

    ## Commands (used within a running tmux session):

    NOTE: All commands need to be prefixed with the action key. By default, this is ```CTRL-b```

    c - create new window
    n/p - move to next/previous window
    0-9 - move to window number 0-9
    l - move to previously selected window
    f - find window by name
    w - menu with all windows
    & - kill current window
    , - rename window

    % - split window, adding a vertical pane to the right
    " - split window, adding an horizontal pane below
    ?/? - move focus to left/right pane
    ?/? - move focus to upper/lower pane
    q - show pane numbers (used to switch between panes)
    o - switch to the next pane

    ! - Break current pane into new window
    x - Kill the current pane.
    d - detach the current client
    ? - list all keybindings

    [ - enter copy mode (then use emacs select/yank keys)
    * press CTRL-SPACE or CTRL-@ to start selecting text
    * move cursor to end of desired text
    * press ALT-w to copy selected text

    ] - paste copied text

    ? - show tmux key bindings