DEV Community

loading...

How I set up my Mac

dieman profile image Alessandro ・3 min read

Keep in mind: some of these steps will be of course optional, such as the iTerm2 installation and configuration. I personally highly suggest the following everything to improve your productivity! If you are at an advanced level already, you can skip all of this.

Let's get started.

Mac Shortcuts

If you are not very experienced with a Macbook, follow this chapter to discover useful tips!

Spotlight Search

This will be your best friend. Are you looking for a specific software or folder... or whatever? Press Command-Space and start writing what you need. You can even use it as a calculator. Try it.

Application Switcher

Press Command-Tab to open the switcher. If you keep Command key pressed you can use Tab repetitively to navigate through the icons and choose the one you wish to use.

Terminal

If you never used Linux or Mac before, you probably need to learn how to use a terminal efficiently. Below a list of the most used commands.

Command Description
cd Home Directory
cd .. Move to parent directory
cd <folder> Move to the specified folder
pwd Show your current directory
ls Display files and subdir in the actual directory
ls -la Same as before but detailed with hidden files as well
mkdir <name folder> Create a new directory
rm -R <folder> Delete folder with its entire content
rm <file> Delete a file
touch <file> Create a file
chmod -x <file> Make a file executable.
./<file> Run an executable file. Example: ./install.sh
top Display info about running processes (similar to Task Manager), you can exit it with CTRL+C
kill <PID> Kill a process using its PID (using the top command, it will be the first column)
cat <file> Output the content of a specified file
nano <file> Open and edit a file with the in-built Linux editor

These are - in my opinion - the basic that you need to navigate easily through the Terminal. There are many other more commands and flags, and if you need a more detailed list, you can always google it.

What to Install

What do you need to install on your new shiny Mac? Below I will cover what I think any Mac should have, and some are real MUST.

Homebrew

Homebrew is a package manager. You can use it to install most of the stuff you need, very fast and from the Terminal.

Open your Terminal and copy-paste this command to install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Enter fullscreen mode Exit fullscreen mode

You can now install new software with the brew install <name> or brew cask install <name> if what you want to install is a graphical GUI application such as our next in the list: Visual Studio Code.

Visual Studio Code

If you still do not have a favourite code editor, I suggest you give VSCode a try.

You can install VSCode with Homebrew:

brew cask install visual-studio-code
Enter fullscreen mode Exit fullscreen mode

After the installation, to be able to use code command from the terminal, we need to first to install the 'code' command in PATH. How? Open VSCode with Spotlight (Command-Space) and press F1 (if you have Touch Bar, press fn and it will appear on it) and type path, select the first sentence and press enter. Now go in the terminal and try to open your current folder with the following command.

code .
Enter fullscreen mode Exit fullscreen mode

Now, have fun customising your new code editor!

A better terminal

iTerm2

It's time to install and customise iTerm2 and finally get rid of the default Terminal. This process will not only make your Terminal look good, but also improve your productivity with syntax highlight, auto-suggestion and tab auto-complete.

Install iTerm2

brew cask install iterm2
Enter fullscreen mode Exit fullscreen mode

Install Oh My Zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Install Powerlevel10k

git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
Enter fullscreen mode Exit fullscreen mode
code ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Visual Studio Code will open then set ZSH_THEME="powerlevel10k/powerlevel10k"

Install Auto-Suggestion

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Enter fullscreen mode Exit fullscreen mode
code ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Now type the following code plugins=(zsh-autosuggestions) on a new line.

Close the terminals (Command-Q) and restart it again (Command-Space iTerm2) and follow the instructions as per your preference.

Syntax highlighting

brew install zsh-syntax-highlighting
Enter fullscreen mode Exit fullscreen mode

Now add source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh at the end of ~./zshrc

Restart the terminal to apply the changes.

What's next?

I will write something else in the near future!

Meanwhile feel free to join us in our ohmyzsh discord if you need any help!

Discussion (2)

pic
Editor guide
Collapse
dineshbhagat profile image
DB

This is my mac book setup
feedback appreciated!

Collapse
rudolphh profile image
Rudy A. Hernandez

Funny I thought this was some article I must’ve read months ago, because I did all of these things when I setup my Mac. Good read, thanks.