This is my third article about getting started

There’s a good writer gene in every programmer

Recently, I bought a New Mac and installed and configured some programs to make it easier to use and operate. This series of articles will share some software, plug-ins and configurations that I use frequently for your reference.

[The records in this article are for my personal PC, you can choose and configure according to your own preferences, you can leave a message to discuss any questions, we will reply as soon as we see them]

background

In the information era, there are a large number of excellent tools, for developers, according to the principle of “less is more”, tool is not the more the better, mainly is because of the quality of tools and individual in the process of using continuous grinding, choose a suitable for their own development tools will get twice the result with half the effort Most of the nuggets users in their daily work and study, Terminal requirements are the most basic, this article mainly hand in hand to introduce how to configure a set of easy to use and beautiful terminal tools on the Mac

Package management tool – Homebrew

As a programmer, how can we do without package management tools? In Linux, we have yum, APT, PKG and other commands to install software. MacOS was born Homebrew, as its Slogan says

The missing package manager for macOS (or Linux)

Homebrew is installed

Homebrew installation is easy to follow on the Homebrew website

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Copy the code

Common commands

The installation package

Brew installCopy the code

Search package Sometimes we are not sure whether the software is installed or cannot remember the specific name of the software, we can use the following command to search for the software

Brew Search [Key words]Copy the code

Uninstall packages

Brew Uninstall [package name]Copy the code

Other specific commands can be viewed through BREw-h

Terminal artifact – iTerm2

For those of you who have used a Mac for the first time, it is not what I want to open the terminal on the Mac and find “gee, it is so ugly”. I have to type so many commands on such an ugly page every day, and the whole person will be in a bad mood and the development efficiency will be low. We also have iTerm2, a completely free terminal tool for macOS that is literally a must-have for Mac programmers

ITerm2 installation

ITerm2 installation is also very simple, open iTerm2 website, the Mac installation of three steps (download -> open -> drag) and we can also use the above mentioned homebrew installation

brew install iTerm2
Copy the code

This is what it looks like when you open it

ITerm2 common functions

Iterm2 has several common functions

Split screen

Cmd + D: Split screen Cmd + Shift + D Split screen up or down

search

Cmd+f can bring up the search box for text search

Pressing TAB on top of the search automatically highlights the content following the current text (the position of a separator, such as a word, comma, etc.) and then pressing Enter copies the content to the clipboard

So if I say search, and I hit TAB, it’s search to

Smart tips

Cmd+; An intelligent prompt is displayed, and you can select and complete the information

The key playback

Cmd+option+b: Play back all the characters you have typed in a period of time. This function is very interesting. After pressing the shortcut key, a progress bar will pop up below

oh-my-zsh

As some of you may have said, it’s black, it’s ugly don’t worry, our oh-my-SH is coming

ZSH is a Unix shell that is compatible with bash. It is said that 99% of bash operations are the same as ZSH, but ZSH is more powerful. Oh-my-zsh integrates some common themes and plug-ins. Make your configuration and usage a little easier

Oh – my – ZSH installation

Curl and WGET are available for installation

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

If you can’t install it using the above two methods, you can try to download it through Git and install it manually

# clone source: git clone git://github.com/robbyrussell/oh-my-zsh.git ~ /. Oh - my - ZSH # copy created. ZSHRC: ZSH -template ~/.zshrc # Make.zshrc work: source ~/.zshrc # (optional)shell switch to ZSH: CHSH -s /bin/ ZSHCopy the code

After completion, iterm2 should look like this

ZSHRC can be opened via vim ~/.zshrc, and saved after modification. Make this work by using source ~/.zshrc.

Modify the theme

You can choose your favorite theme in the oh-my-zsh theme for configuration. I chose YS here.

ZSHRC vim ~/.zshrc # find the ZSH_THEME line # change it to ZSH_THEME="ys" (you can also use ys) # save the change and exit # make the change effective source ~/.zshrcCopy the code

Install the Powerline

Powerline is a rendering script written in Python that solves many of the font problems in Oh-my-zsh

pip install --user powerline-status
Copy the code

Set the font

With the rendering script, it’s time to install the fonts

# clone git clone https://github.com/powerline/fonts.git --depth=1 # install cd fonts ./install.sh # clean-up a bit cd . rm -rf fontsCopy the code

Configure the plug-in

There are a lot of oh-my-zsh plugins. You can check them in the plugins. Here are some convenient ones to use

Highlighting effect

ZSH -syntax-highlighting this plugin is for grammar highlighting

Git clone ://github.com/zsh-users/zsh-syntax-highlighting.git vim ~/.zshrc Plus ZSH -- syntax highlightingCopy the code

Command completion

CD ~/. Oh-my-zsh /custom/plugins/ git clone https://github.com/zsh-users/zsh-autosuggestions vim ~/ zsh-autosuggestionsCopy the code

Here there are some things to write, not finished, such as iterm2 some topic configuration, background Settings and so on, after find time will continue to update in this article, interested partners can continue to pay attention to

Write in the last

Tools are just a means to improve the efficiency of our work, study and development. Don’t be bound by it. Just choose the method that suits you


Thank you for your time

I am Wu Liu, a programmer who loves basketball and coding

Follow me and bring you more of what you want to see ❤