Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is my setup as well. I open two terminal windows: the one on the left is used for "control" stuff, and the one on the right is for code. Then in each terminal I run tmux. For a Rails project, I have separate tmux windows for models, controllers, views, stylesheets, a psql prompt, etc. I've done it long enough that I know which window has which stuff, and each vim session only has a few files open, so it's easy to `:ls` and `:e #3` around. My scripts to launch tmux look like this:

    # ~/bin/ss-ctrl
    #!/bin/sh
    
    env_name=ctrl
    long_name=skillspy
    short_name=ss
    
    cd ~/src/${long_name}/site && \
    tmux new-session -d -s ${short_name}-${env_name} && \
    tmux rename-window -t ${short_name}-${env_name}:1 git && \
    tmux new-window -t ${short_name}-${env_name}:2 -n log 'RAILS_ENV=development rails s -p 3009; bash -i' && \
    tmux new-window -t ${short_name}-${env_name}:3 -n db 'ssdb; bash -i ' && \
    tmux new-window -t ${short_name}-${env_name}:4 -n misc && \
    tmux new-window -t ${short_name}-${env_name}:5 -n redis 'cd ~/src/redis-2.6.0-rc8/src && ./redis-server && date && bash -i' && \
    tmux new-window -t ${short_name}-${env_name}:6 -n sidekiq 'RAILS_ENV=development bundle exec sidekiq | tee log/sidekiq.log; date; bash -i' && \
    tmux select-window -t ${short_name}-${env_name}:1 && \
    tmux -2 attach-session -t ${short_name}-${env_name}


    # ~/bin/ss-code
    #!/bin/sh
    
    env_name=code
    long_name=skillspy
    short_name=ss
    
    cd ~/src/${long_name}/site/app/models && \
    tmux new-session -d -s ${short_name}-${env_name} && \
    tmux rename-window -t ${short_name}-${env_name}:1 models 
    
    cd ~/src/${long_name}/site/app/controllers && \
    tmux new-window -t ${short_name}-${env_name}:2 -n controllers

    cd ~/src/${long_name}/site/app/views && \
    tmux new-window -t ${short_name}-${env_name}:3 -n views
    
    cd ~/src/${long_name}/site/app/assets/stylesheets && \
    tmux new-window -t ${short_name}-${env_name}:4 -n css
    
    cd ~/src/${long_name}/site/app/assets/javascripts && \
    tmux new-window -t ${short_name}-${env_name}:5 -n js
    
    cd ~/src/${long_name}/site/app/workers && \
    tmux new-window -t ${short_name}-${env_name}:6 -n workers
    
    tmux select-window -t ${short_name}-${env_name}:1 && \
    tmux -2 attach-session -t ${short_name}-${env_name}



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: