4
头图

delicious value: 🌟🌟🌟🌟🌟

taste: summer black grape

Taking advantage of the configuration environment for the new computer at hand, by the way, I compiled a wave iTerm2 + oh-my-zsh and shared it with everyone.

If you have an efficient terminal, then every morning when you come to the company, you only need the following three steps of keyboard operation to start a day of happy coding time.

  1. option + press Enter to evoke iTerm2
  2. j work , jump to the working directory
  3. code . , use VSCode to open the current folder project (VSCode comes with a command line)

It is so efficient, so how to build it? Take 10 minutes and follow the steps below.

In this process, you may encounter various problems. I have posted relevant solutions in the article as much as possible to help you download and configure smoothly.

iTerm2

First click on the link below to download iTerm2.

Set wake up hotkey

After downloading, in order to wake up the iTerm2 window more conveniently ( at the beginning of this article), we also need to set a hotkey.

Follow the iTerm2 => Preferences => Keys => HotKey find the configuration item HotKey for configuration.

It can quickly evoke the terminal and hide it. I set option + Enter, option + space is left for uTools . uTools is also a productivity tool that I like very much, and interested readers can learn about it by themselves.

Commonly used shortcut keys

  • ctrl + u Clear the current line of input
  • ctrl + a quickly switch to the current input text header
  • ctrl + e quickly switch to the end of the currently entered text
  • cmd + d vertical split screen
  • cmd + shift + d horizontal split screen
  • cmd + r clear screen
  • cmd + t open a new iterm2 Tab
  • cmd + left and right arrow keys to switch Tab left and right
  • cmd + n open a new iterm2 window
  • cmd + press enter to switch to full screen
  • cmd + w close tab
  • cmd + f find
  • cmd + shift + h View clipboard history

oh-my-zsh

For some installation pits, the solutions can refer to the following links:

Configure the theme

First, use the command vim ~/.zsh open the configuration file, and then set the theme you like. You can go to the following two links to view the recommendations in the community and the official skin preview list.

ZSH_THEME="ys"

Finally, execute the command source ~/.zshrc to re-execute the zsh configuration file to make the configuration effective.

Configure plugin

In order to achieve the operation at the beginning of this article, we also need to download some plug-ins. Here are some plug-ins that are frequently used daily. For more plug-ins, please go to the official website for inquiries.

git plugin

The git plugin provides a lot of aliases to simplify your git commands. You can find them in the link above.

autojump plugin

Using j + directory abbreviation, you can flexibly jump between any directories, and finally you don’t need cd!

(implement the second step at the beginning of this article)

# 打开 vue3 文件夹
j vue3

# 支持多个参数 /user/tong/work/li
j w li

zsh-syntax-highlighting

The syntax is highlighted, and there is a comparison example before and after installation in the official website link.

Execute the following command to install.

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
vim ~/.zshrc # 输入命令在 zshrc 中配置
plugins=(其他的插件 zsh-syntax-highlighting)

Save the configuration and run the following command to make the configuration effective.

source ~/.zshrc

zsh-autosuggestions

According to the command history, prompt prompts are provided, which is invincible and easy to use.

Execute the following command to install.

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
vim ~/.zshrc # 输入命令在 zshrc 中配置
plugins=(其他的插件 zsh-autosuggestions)

Save the configuration and run the following command to make the configuration effective.

source ~/.zshrc

If you have successfully reached here all the way, congratulations, you can try the three operation steps at the beginning of this article. Coupled with the commonly used shortcut keys, I believe your terminal is already very cool to use! Go ahead and try it~


童欧巴
2.6k 声望4.2k 粉丝