As a fat house programmer, need to use Terminal every day, how can not toss iTerm2 so a working tool, not to say much, directly walk, let you see some of my small GaiGai ~ record my love toss results


1. Introduction

Since 2017 began to use Macbook, the terminal has been using iTerm2, every time to get a new machine is the first toss about this, before and after also used more skilled, to share with you some of my iTerm2 use and configuration.

1.1 introduce iTerm2

ITerm2 iTerm2 is a completely free, terminal tool for MacOS.

Download link: www.iterm2.com/

1.2 rendering

No more words, first on my terminal renderings well:

How about my small GaiGai is not very beautiful ~ below see the detailed configuration

2. The configuration starts

2.1 oh my ZSH

ITerm2 such a sharp tool, of course, to configure powerful shell, native ZSH configuration is relatively easy to lose hair, but there has been open source configuration OH my ZSH to provide us, only a simple configuration can change the style at will, plug-ins and other functions.

2.1.1 installation

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

# wget
sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Copy the code

After installation, shell will automatically switch to ZSH. If you do not have ZSH installed on your machine, you can install ZSH first.

brew install zsh
Copy the code

The.zshrc file and.oh-my-zsh are generated in the user root directory, the former is the configuration file, and the latter is the directory where themes and plugins are stored. It’s mainly configuration files, you can install custom plugins to the.oh-my-zsh directory if necessary.

2.1.2 Common plug-ins

The plugin is recommended

Here are some of my favorite plug-ins:

plugins=(git z zsh-syntax-highlighting zsh-autosuggestions)
Copy the code
  • Git: used to display Git project information after your host name, such as branch, directory, current project status, etc.
  • z: Used to quickly jump between directories, for example, before entering~/User/my_projectAfter the directory, the next time you want to enter, directlyz my_projectCan, for a long directory jump is very practical;
  • ZSH – synchro-highlighting: For highlighting common commands, such as ls, CD, etc., green, red when typing wrong commands;
  • zsh-autosuggestions: When you type commands, the recommended commands that you might want to type are displayed in gray, directly to the keyboard-I’ll be able to complete the command.

These plugins are basically already included with oh my ZSH, so go to the plugins parameter in the configuration file and write the plugins you want in parentheses.

Custom plug-in installation

Sometimes the above plug-ins are not installed by default, or you need to install third-party plug-ins and write your own plug-ins, which can be manually installed and configured.

~/.oh-my-zsh/custom/plugins
~/.oh-my-zsh/custom/themes
Copy the code

Download the plugin file or theme file into the above two folders, and add the configuration file.

  • Github plugin list

2.1.3 Terminal Style

ZSH_THEME="ys" # configuration. ZSHRC
Copy the code

You can preview a variety of theme styles online and change the configuration as you like. If you do not have a theme installed, install it as a plug-in.

  • List of Github topics

Now that the oh My ZSH Shell environment is configured, let’s look at the iTerm2 configuration.

2.2 iTerm2 configuration

2.2.1 Window configuration

Configure an immersive border and change the default Theme to Minimal

2.2.2 Topic Configuration

In my renderings of the use of Dracula color, you can download their own configuration.

  • Dracula download address

Decompress the package and import the configuration to iTerm2. In the red box, select Import to import the Dracula. Itermcolors configuration file. Choose Dracula for a different color scheme.

2.2.3 Font Configuration

The font I use here is M+ equal width font, the download link is here, download and install to the computer. According to the requirements to select font, configure the thickness, size and other Settings.

2.2.4 Background Configuration

transparency

The first is the configuration of transparency. The progress bar in box A allows you to set transparency, and by the way, Settings for New Windows allows you to set the default window width.

Fat house happy little GaiGai

Now comes the exciting part, GaiGai!! As shown in the above picture, check the B box to start the background picture and import the little sister you like. In Mode, you can set the tile Mode of the picture. So the problem comes, where can find beautiful little sister, send big guys a note of wallpaper Site.

  • The best wallpapers on the Net!

My little sister is from here, there are hot list, classification, picture size adjustment, wallpaper trial and so on, you can certainly find the small GaiGai ~

2.2.5 Status Bar Configuration

The next step is to configure the status bar on the terminal. It can pull power information, CPU usage, memory usage, network monitoring, clock and other functions, which is really a powerful tool to install.

The configuration that can think of at present is above these, what new discovery compensates again later come up.

3. Use skills

3.1 Common Shortcut Keys

Here are some common shortcuts:

  • Command + D: Vertical split window
  • Command + Shift + D: Split window horizontally

Okay, that’s it. I’ll just use these two…

4. Call it a day

With more than two years of iTerm2, today finally took the time to sort out the configuration method, now the cloud saved a configuration file, too lazy to toss about.

Vegetable chicken roll, slip ~