Setting up my Mac and iTerm... again!
Over the last three years I've setup three new Macbooks for myself and found myself repeating the same steps pretty much every time. This month I setup my fourth, but did things slightly differently. Here's a few quick shortcuts I take to get setup quicker:
Automate it stupid
A short while back I came across Oliver J. Ash's mac setup repo, a set of scripts to help automate the initial faff of customising the new machine to your preferences - fantastic! I forked this and made some changes to tailor my Mac settings and applications.
If you take a look at the
install-deps.sh script, you'll see it installs Sublime Text, my editor of choice. A massive annoyance of a new machine was re-installing all the packages I use, swapping key bindings and copying over snippets.
Oliver's script has a handy bit of code that clones a GitHub repository containing all the user settings for a Sublime instance. This means that with my new machine, it'll grab all my packages and settings from [my GitHub repo][sublime-settings-repo) and replace the install user folder with my own. It works surprisingly well and means that I could have my own Sublime setup up and running on any machine.
The only thing is, you've got to remember to occasionally push any changes back up to GitHub.
In amongst the series of applications that are installed is iTerm, a fantastic terminal replacement. Along with that, I install
oh-my-zsh, all of which you should checkout if you don't currently use them. Unfortunately there's a few quirks with iTerm that slowdown my obsessive need to only use the keyboard.
Home/End shortcuts If you don't have a full width keyboard, chances are you will use
⌘+ → to go to the start and end of the line. Those keys aren't mapped automatically in iTerm, but you can add them:
- Open iTerm's preferences (
⌘+,), click on
- Click the
+button below the list of mappings and hit the keyboard shortcut you wish to use (either
- In the action dropdown, select
Send Hex Code
- Set the value as
0x01for moving to the beginning of the line and
0x05for the end of the line.
Deleting a word Another huge annoyance is not being able to delete a single word using the popular keyboard shortcut
⌥+⌫. To enable this, follow steps 1-3 above and use the code
Deleting the whole line Again, if you wish to delete an entire line using
⌘+⌫ then follow steps 1-3 above and use the code
Maintain current directory when splitting a pane This is a real pane (whey!). Simple fix. Got preferences and click the
profiles tab again but make sure that you are on the
General tab. Look down to wear it says
Working Directory and click
Edit next to
Advanced configuration. The bottom option should be what to do when you split a pane. Select
Reuse previous session's directory. Done!