Easy project switching with Itermocil & command line shortcuts
I often need to switch between multiple projects, or maybe I'm just getting started for the day. Spending time booting up these project environments is a waste.
These steps assume you use Mac, iTerm2, and VSCode
First, install Itermocil for pre-configured layouts and commands saved in
$ brew update && brew install TomAnthony/brews/itermocil$ mkdir ~/.itermocil && touch ~/.itermocil/projectname.yml$ open ~/.itermocil/projectname.yml
Paste in this layout:
windows:- name: projectnameroot: /path/to/projectlayout: even-horizontalpanes:- npm run start- git status
You can test this by typing
itermocil layout in iTerm2.
Command Line Shortcuts
To make this process even faster (9 keystrokes faster), you can create an alias for each of your layouts.
$ echo 'alias projectname = "itermocil projectname"' >>~/.bash_profile$ source ~/.bash_profile$ projectname
You could take this a step further by opening VS Code to your project directory as part of the same alias.
code to your shell by following these steps (These are Mac instructions, check the link for other platforms):
- Open VS Code
F1and search "shell"
- Click on
Shell Command: Install 'code' command in PATH
Now update your alias:
alias projectname = "itermocil projectname && code path/to/project/dir"