When executing commands in the git directory under oh-my-zsh, there is noticeable lagging. Even simple commands like cd and ls will lag. After investigation, it is found that the issue lies with the agnoster theme, which reads the git configuration information. If there are too many files in the project directory, the lagging will be very obvious. Indeed, aesthetics and performance are ultimately a choice between the two.
You can use the following command to disable zsh from automatically retrieving git information and solve the lagging issue:
git config --global oh-my-zsh.hide-status 1
If it is for a specific directory, you can execute the following command in the git project directory:
Set oh-my-zsh to not read file change information:
git config --add oh-my-zsh.hide-dirty 1
You can further set oh-my-zsh to not read any git information:
git config --add oh-my-zsh.hide-status 1
Reference: https://my.oschina.net/u/614511/blog/646012