Skip to content

Instantly share code, notes, and snippets.

@thesunwave
Forked from royling/tmux-iterm2.md
Created November 7, 2017 14:25
Show Gist options
  • Save thesunwave/7a87ea682a2b038fab7be51c71158093 to your computer and use it in GitHub Desktop.
Save thesunwave/7a87ea682a2b038fab7be51c71158093 to your computer and use it in GitHub Desktop.

Revisions

  1. @royling royling revised this gist Sep 24, 2016. 1 changed file with 27 additions and 3 deletions.
    30 changes: 27 additions & 3 deletions tmux-shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,28 @@
    - `Ctrl-b` as prefix
    # Common:
    - `Ctrl-b`: prefix
    - `?`: list key bindings
    - Up/Down: above/below pane
    - Left/Right: left/right pane
    - `:`: command prompt
    - `[`: enter copy mode
    - `]`: paste

    # Sessions:
    - `$`: rename session
    - `d`: detach current client
    - `D`: choose client to detach

    # Windows:
    - `c`: create a window
    - `0-9`: select window
    - `&`: kill current window
    - `,`: rename current window
    - `p/n`: previous/next window

    # Panes:
    - `%`: horizontal split (current pane => left & right panes)
    - `"`: vertical split
    - `;/o`: previous/next pane
    - `Up/Down/Left/Right`: move to above/below/left/right pane
    - `!`: break current pane out of window
    - `x`: kill current pane
    - `{/}`: swap current pane with prev/next pane
    - `Ctrl-Up/Down/Left/Right`: resize pane
  2. @royling royling revised this gist Sep 24, 2016. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion tmux-shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,3 @@
    - `?`: list key bindings
    - Up/Down: above/below pane
    - Left/Right: left/right pane
    -
  3. @royling royling revised this gist Sep 24, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions tmux-shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    - `Ctrl-b` as prefix
    - `?`: list key bindings
    - :up:: above pane
    - :down:: below pane
    - :left:: left pane
    - Up/Down: above/below pane
    - Left/Right: left/right pane
    -
  4. @royling royling revised this gist Sep 24, 2016. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions tmux-shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    - `Ctrl-b` as prefix
    - `?`: list key bindings
    - :up:: above pane
    - :down:: below pane
    - :left:: left pane
  5. @royling royling revised this gist Sep 24, 2016. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions tmux-iterm2.md
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,6 @@ Run `tmux -CC` or `tmux -CC attach` in iTerm2 and then menu is shown on terminal
    - `lsw -t target-session` alias for `list-windows`

    ## target-window
    - specified in form: `session:window`
    - `mysession:1`
    - specified in form: `session:window`, eg. `mysession:1`
    - ID: `@1`
    - name: `mysession:mywindow` / `mysession:mywin` / `mysession:=mywindow`
  6. @royling royling revised this gist Sep 24, 2016. 1 changed file with 10 additions and 4 deletions.
    14 changes: 10 additions & 4 deletions tmux-iterm2.md
    Original file line number Diff line number Diff line change
    @@ -9,21 +9,27 @@ Run `tmux -CC` or `tmux -CC attach` in iTerm2 and then menu is shown on terminal
    - L for log

    # Control sessions
    - `new -s session-name [-c working-dir]` alias for `new-session`
    - `new -s session-name [-c working-dir] [shell-cmd]` alias for `new-session`
    - `kill-session -t target-session`
    - `rename [-t target-session] new-name` alias for `rename-session`
    - `ls` alias for `list-sessions`
    - `attach -t target-session [-c working-dir]` alias for `attach-session`

    ## target-session
    - ID with `$` prefix: $2
    - name: 'mysession' or '=mysess' (exact match)
    - ID: `$1`
    - name: `myse` or `=mysession` (exact match)

    # Clients
    - `lsc` alias for `list-clients`

    # Windows
    - `lsw -t target-session` alias for `list-windows`
    - `neww [-c working-dir] [-t target-window] -n window-name [shell-cmd]` alias for `new-window`
    - `killw -t target-window` alias for `kill-window`
    - `renamew -t target-window new-name` alias for `rename-window`
    - `lsw -t target-session` alias for `list-windows`

    ## target-window
    - specified in form: `session:window`
    - `mysession:1`
    - ID: `@1`
    - name: `mysession:mywindow` / `mysession:mywin` / `mysession:=mywindow`
  7. @royling royling revised this gist Sep 24, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tmux-iterm2.md
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ Run `tmux -CC` or `tmux -CC attach` in iTerm2 and then menu is shown on terminal
    - `attach -t target-session [-c working-dir]` alias for `attach-session`

    ## target-session
    - ID: 0-9
    - ID with `$` prefix: $2
    - name: 'mysession' or '=mysess' (exact match)

    # Clients
  8. @royling royling created this gist Sep 24, 2016.
    29 changes: 29 additions & 0 deletions tmux-iterm2.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    # Install tmux
    `brew install tmux`

    # Start tmux (https://gitlab.com/gnachman/iterm2/wikis/TmuxIntegration)
    Run `tmux -CC` or `tmux -CC attach` in iTerm2 and then menu is shown on terminal:
    - ESC to detach
    - C to run commands
    - X to force quit
    - L for log

    # Control sessions
    - `new -s session-name [-c working-dir]` alias for `new-session`
    - `kill-session -t target-session`
    - `rename [-t target-session] new-name` alias for `rename-session`
    - `ls` alias for `list-sessions`
    - `attach -t target-session [-c working-dir]` alias for `attach-session`

    ## target-session
    - ID: 0-9
    - name: 'mysession' or '=mysess' (exact match)

    # Clients
    - `lsc` alias for `list-clients`

    # Windows
    - `lsw -t target-session` alias for `list-windows`
    - `neww [-c working-dir] [-t target-window] -n window-name [shell-cmd]` alias for `new-window`
    - `killw -t target-window` alias for `kill-window`
    - `renamew -t target-window new-name` alias for `rename-window`