4 Apps Must Install On Your Mac for Development in 2020
By: Jason Zhang
Tags: Mac, Productivity, Iterm2, Alfred, Apps

4 Apps Must Install On Your Mac for Development in 2020

4 well-chosen apps for developers

Crew Demo-2 Mission by Offical SpaceX Photos

In the last post: How to make your Mac more effectively for developers? I introduced some basic Mac configuration for programmers. In this article, I will continue to introduce some useful apps on your Mac. （If you are new here, I strongly suggest to read the last article before reading this story.）

1. Amazing Terminal: iTerm2

iTerm2

iTerm2 is a replacement for Terminal. You can install it with one line command using Homebrew Cask or downland.

brew cask install iterm2

Cursor movement

In the last article, we talk about the system shortcut keys, it also can be used in iTerm2. Such as, move to the beginning/end of the line (⌃-A/E), move left/right (⌃-B/F) or delete characters (⌃-H), etc.

You can also view and customize shortcut keys in iTerm2. Preferences>Keys>Key Bindings

Key Bindings

Text Selection

There are three ways to select text in iTerm2:

Double click: word selection

Three clicks: line selection

Four clicks: smart selection

iTerm2 offers a Smart Selection feature that simplifies making selections on semantically recognizable objects. For a complete introduction, please refer to the official documentation. Smart Selection is great in the following situations:

Words bounded by whitespace or line boundaries.

language-style pairs of identifiers separated by double colons, such as namespace::identifier or foo.bar.baz .

or . Quoted strings such as foo bar .

. URIs with the schemes: mailto, http, https, ssh, or telnet.

Email addresses.

Under Preferences>Profiles>Advanced, you may view and edit the smart selection rules.

Smart selection

By default, the text is copied when the text is selected in iTerm2. So you don’t need to use Command-C.

Sometimes, if there is a small error in the previous command, you don’t have to type it again. You can use ^old^new to replace it.

replace

2. Ultimate Shell— Zsh & Oh My Zsh

oh-my-zsh

Zsh is a shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of bash, ksh, and tcsh were incorporated into zsh; many original features were added. But the configuration of zsh is so complicated that few people use it. Until the emergence of the Oh My Zsh project, let us quickly get started with zsh.

Installation

$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

or

$ sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

Configuration

There is a ~/.zshrc in your home directory, this is your configuration file. Open it up with your favorite text editor, I choose vim.

You can set Environment variable , Alias , Theme , plugins ,etc.

You can add alias like this.

alias cls='clear'

alias ll='ls -l'

alias la='ls -a'

alias vi='vim'

alias grep="grep --color=auto"

alias -s gz='tar -xzvf'

alias -s tgz='tar -xzvf'

alias -s zip='unzip'

alias -s bz2='tar -xjvf'

......

If you have no experience in alias , you can use the Oh My Zsh common-aliases plugins.

Plugins

Oh My Zsh plugins allow you to add the functionality of many sorts to your shell just by enabling them. They are each documented in the README file in their respective plugins/ folder.

Enable a plugin by adding its name to the plugins array in your .zshrc file. For example, this enables the rail , git , autojump , and ruby plugins, in that order:(elements are separated by spaces.)

plugins=(rails git autojump ruby)

The following is a brief introduction:

git:

The git plugin provides many aliases and a few useful functions. Such as g = git , ga = git add , etc. When you are in a git controlled directory, Zsh will clearly display “git” and “branch”, as shown below.

Autojump:

Autojump is a perfect combination of Zsh and Autojump. Autojump is a faster way to navigate your filesystem. You have to install Autojump first. Homebrew is the recommended installation method for macOS:

brew install autojump

And add autojump to the plugins array in your ./zshrc file:

plugins=(... autojump)

Zsh will automatically record the directories you have visited. Using j foo you can directly jump to the directory. For example, if you have visited the CoreML directory, enter j Co to jump correctly. j -stat can show database entries and their key weights.

Autosuggestions:

It suggests commands as you type based on history and completions.

Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins )

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc ):

plugins=(... zsh-autosuggestions)

3. Alfred — Enhanced Edition Spotlight

Alfred

Alfred Hotkey

Firstly, set the hotkey for Alfred startup. Here, for convenience, I set it to double-click the Command Key (⌘).

alfred hotkey

Find apps & files

Double-click Command to open the Alfred Window, then enter the file/app name. You will see the file and app in the search bar just press Return key or shortcut keys.

alfred search

You can add additional file types and setting your search scope in Alfred’s preferences under Features > Default Results.

alfred search

Search the web

It only takes two steps to search the web in Alfred.

Pop up Alfred using Hotkey.

Enter search contents and press Return Key or shortcut keys.

Alfred Search the Web

You can modify default web searches in Alfred’s preferences under Features > Web Search.

web search

The following features are Alfred's advanced features that you need to buy the Powerpack License.

Clipboard History

Alfred clipboard history is an incredibly useful tool to help you be more efficient. Before you can start using the Clipboard History feature, you need to enable it in Alfred’s Preferences, under Features > Clipboard, and grant Alfred Accessibility permissions in macOS.

clipboard

You can set the history types, how long you want Alfred to remember your clips for, Viewer Hotkey, etc. I set to keep Plain Text, Images, and File Lists for 3 months, 1 month, and 1month respectively. At the same time, set the Viewer Hotkey to Command+Shift+C. Using hotkey we will see:

viewer clipboard history

Snippets and Text Expansion

By using snippets to save your frequently used text clips, such as email, phone number, address, URL, etc. Expand them automatically using a keyword or browse for the right clip in the Snippets Viewer. Firstly, you need to activate Automatically expand snippets by keyword. With auto-expansion, you can expand your snippets automatically in any app by typing the snippet’s keyword, without popping up Alfred’s Snippets window!

To use the snippet, simply type the keyword you set into the app or text field you want. As if by magic, your keyword will be replaced will the full text snippet. For example, enter !dt and replace it with the current date and time.

snippet

For more snippet settings, please refer to the official documentation.

Workflows

With Alfred’s workflows, we can extend Alfred and get things done in our own way. We can create our workflows or find hundreds more on official workflows or Packal.

Here I will demonstrate the workflow I installed. This workflow can do some calculations about the date, such as calculating how many days are between two dates. You can see that there is 1 week, 3 days between 2020–05–25 and 2020–06–04.

More about Alfred Workflows and Customize Search, please see my other article.

4. Code editing. Redefined. — Visual Studio Code

If you are only allowed to install an IDE on your Mac, I will not hesitate to choose VSCode.

Visual Studio Code is a lightweight but powerful source code editor that runs on your Mac. It comes with built-in support for Front-end development( JavaScript, TypeScript, Node.js, CSS) and has a rich ecosystem of extension for other languages(such as C++, C#, Java, Python, PHP, Go) and embedded development(PlatformIO).

Installation:

Download Visual Studio Code for macOS.

Drag Visual Studio Code.app to the Applications folder, making it available in the macOS Launchpad.

Command Palette:

From Command Palette, you have access to all of the functionality of VS Code, including keyboard shortcuts for the most common operations.

Keyboard Shortcut: ⇧⌘P

Keyboard Shortcuts:

VS Code provides rich and easy keyboard shortcuts helping developer coding fast and effective. You can also install a Keymap extension that brings the keyboard shortcuts from your favorite editor to VS Code.

Extensions:

In the Extensions view, you can search extensions, show recommended extensions and Install&Manage extensions. You can even create your own extension.

You can find more extensions in the Marketplace or community curated extension lists. such as awesome-vscode.

For more tips&ticks on VS Code, please see the Offical Document or my other article.

One More Thing ……

A Special app for Data Scientist Developer —— Mathpix Snipping Tool

As data science & machine learning developers, science students, or scientific researchers, sometimes we need to use Markdown and LaText to write documents or papers. Mathpix can help us extract equations from PDFs or handwritten notes in seconds just by taking a screenshot, paste the resulting LaTeX code into any Markdown or LaTeX editor.

Capture your desired inputs within the screenshot box

Check the equation and copied.

Paste the LaTeX into any compatible editor.

The Mathpix provides 50 snips per month for a free account, which is enough for me.

Thanks for reading. 🖖 Live long and prosper 🖖