Skip to content

Instantly share code, notes, and snippets.

@montethinks
Last active February 21, 2024 11:27
Show Gist options
  • Select an option

  • Save montethinks/2f4c43c900b6df5160422b4013d7c93f to your computer and use it in GitHub Desktop.

Select an option

Save montethinks/2f4c43c900b6df5160422b4013d7c93f to your computer and use it in GitHub Desktop.

Revisions

  1. montethinks revised this gist Oct 5, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion work.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ session="work"
    # set up tmux
    tmux start-server

    # create a new tmux session, starting vim from a saved session in the new window
    # create a new tmux session with <NAME>
    tmux new-session -d -s $session -n servers

    # Select pane 1, set dir to <PROJECT NAME>
  2. montethinks created this gist Sep 4, 2018.
    39 changes: 39 additions & 0 deletions work.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    #!/bin/sh

    # Setup a work space called `work` with four windows

    session="work"

    # set up tmux
    tmux start-server

    # create a new tmux session, starting vim from a saved session in the new window
    tmux new-session -d -s $session -n servers

    # Select pane 1, set dir to <PROJECT NAME>
    tmux selectp -t 1
    tmux send-keys "cd ~/path/to/project" C-m

    # Select pane 2
    tmux splitw -h
    tmux send-keys "cd ~/path/to/project" C-m

    # create a new window called <PROJECT NAME>
    tmux new-window -t $session:2 -n <PROJECT NAME>
    tmux send-keys "cd ~/path/to/project" C-m
    tmux send-keys "vim ." C-m

    # create a new window called <PROJECT NAME>
    tmux new-window -t $session:3 -n <PROJECT NAME>
    tmux send-keys "cd ~/path/to/project" C-m
    tmux send-keys "vim ." C-m

    # create a new window called <PROJECT NAME>
    tmux new-window -t $session:4 -n scratch

    # return to main servers window
    tmux select-window -t $session:1

    # Finished setup, attach to the tmux session!
    tmux attach-session -t $session