News for hackers. Stuff that matters.

Ask HN: Workflow for switching between projects

I always work in several projects in parallel. All of them use Git (for version control and sometimes deployments) and a task runner (grunt/gulp).

I switch between projects several times a day. This means closing the terminal window I'm currently on, opening a new one, splitting it in 2 (I use iTerm), navigating to the project folder in each of them, starting up Grunt/Gulp in one of them and managing Git in the other, and then switching projects in Sublime.

This routine gets very boring very quickly. I'm looking into ways to automate it, but the only solution I've found is to write a bash script for each project, which isn't ideal because:

1. It means a new custom script for each new project (the projects are usually quite small and have fast turnarounds, so I would have to do this a couple of time a month) 2. iTerms panes and bash scripts don't play very well along

I was wondering what other people's workflows were like? There must be a better way.

( 7 comments | 3 points | on HN )
Re:Ask HN: Workflow for switching between projects by hkarthik on Saturday February 14, 2015 @06:43PM (#9051163)
I use tmux and either tmuxinator or teamocil to accomplish this. I use vim as my editor so it just works within the shell.

Each project can have its own tmuxinator config and load up tmux with a number of shells. There is even native tmux support built into iTerm2 but I haven't used it.

Re:Ask HN: Workflow for switching between projects by gnachman on Friday February 13, 2015 @05:45PM (#9047704)
Why not use a saved window arrangement? It'll restore your splits, and working directories too if you use the nightly build.
Re:Ask HN: Workflow for switching between projects by cauterized on Thursday February 12, 2015 @10:54AM (#9039308)
Why not just use one iTerm window for each and minimize the inactive ones or use a separate virtual desktop for each project?
Re:Ask HN: Workflow for switching between projects by efriese on Thursday February 12, 2015 @10:57AM (#9039328)
Yeah, that's what I do. I just use a separate virtual desktop for each project I'm working on. I've thought about writing scripts to pull everything up, but I've never taken the time.
Re:Ask HN: Workflow for switching between projects by biomene on Thursday February 12, 2015 @12:58PM (#9040146)
But you still have to open the iTerm with split panel and navigate to the correct folders the first time you open a project every day. These are the steps I want to automate.
Re:Ask HN: Workflow for switching between projects by cauterized on Thursday February 12, 2015 @01:22PM (#9040309)
Why do you close everything out every night?
Re:Ask HN: Workflow for switching between projects by biomene on Thursday February 12, 2015 @08:13PM (#9042336)
That's a good question.