折腾:
【未解决】Win中VMWare中macOS初始化开发环境
期间,继续去Win中VMWare的macOS中,安装iTerm2,安装插件,安装主题。
参考自己之前的教程去操作
【已解决】mac的iterm2安装oh-my-zsh
去下载



即可正常使用。
继续参考
去设置
crifanlideMac:~ crifanli$ chsh -s /bin/zsh Changing shell for crifanli. Password for crifanli: crifanlideMac:~ crifanli$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" Cloning Oh My Zsh... Cloning into '/Users/crifanli/.oh-my-zsh'... remote: Enumerating objects: 1153, done. remote: Counting objects: 100% (1153/1153), done. remote: Compressing objects: 100% (1118/1118), done. remote: Total 1153 (delta 20), reused 1097 (delta 19), pack-reused 0 Receiving objects: 100% (1153/1153), 772.72 KiB | 18.00 KiB/s, done. Resolving deltas: 100% (20/20), done. Looking for an existing zsh config... Using the Oh My Zsh template file and adding it to ~/.zshrc. Time to change your default shell to zsh: Do you want to change your default shell to zsh? [Y/n] y Changing the shell... Changing shell for crifanli. Password for crifanli: chsh: no changes made Shell successfully changed to '/bin/zsh'. __ __ ____ / /_ ____ ___ __ __ ____ _____/ /_ / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ / /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / \____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ /____/ ....is now installed! Please look over the ~/.zshrc file to select plugins, themes, and options. p.s. Follow us on https://twitter.com/ohmyzsh p.p.s. Get stickers, shirts, and coffee mugs at https://shop.planetargon.com/collections/oh-my-zsh ➜ ~

看看当前配置
➜ ~ cat ~/.zshrc # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. export ZSH="/Users/crifanli/.oh-my-zsh" # Set name of the theme to load --- if set to "random", it will # load a random theme each time oh-my-zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes ZSH_THEME="robbyrussell" # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load # a theme from this variable instead of looking in $ZSH/themes/ # If set to an empty array, this variable will have no effect. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" # Uncomment the following line to use hyphen-insensitive completion. # Case-sensitive completion must be off. _ and - will be interchangeable. # HYPHEN_INSENSITIVE="true" # Uncomment the following line to disable bi-weekly auto-update checks. # DISABLE_AUTO_UPDATE="true" # Uncomment the following line to automatically update without prompting. # DISABLE_UPDATE_PROMPT="true" # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 # Uncomment the following line if pasting URLs and other text is messed up. # DISABLE_MAGIC_FUNCTIONS=true # Uncomment the following line to disable colors in ls. # DISABLE_LS_COLORS="true" # Uncomment the following line to disable auto-setting terminal title. # DISABLE_AUTO_TITLE="true" # Uncomment the following line to enable command auto-correction. # ENABLE_CORRECTION="true" # Uncomment the following line to display red dots whilst waiting for completion. # COMPLETION_WAITING_DOTS="true" # Uncomment the following line if you want to disable marking untracked files # under VCS as dirty. This makes repository status check for large repositories # much, much faster. # DISABLE_UNTRACKED_FILES_DIRTY="true" # Uncomment the following line if you want to change the command execution time # stamp shown in the history command output. # You can set one of the optional three formats: # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" # or set a custom format using the strftime function format specifications, # see 'man strftime' for details. # HIST_STAMPS="mm/dd/yyyy" # Would you like to use another custom folder than $ZSH/custom? # ZSH_CUSTOM=/path/to/new-custom-folder # Which plugins would you like to load? # Standard plugins can be found in $ZSH/plugins/ # Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=(git) source $ZSH/oh-my-zsh.sh # User configuration # export MANPATH="/usr/local/man:$MANPATH" # You may need to manually set your language environment # export LANG=en_US.UTF-8 # Preferred editor for local and remote sessions # if [[ -n $SSH_CONNECTION ]]; then # export EDITOR='vim' # else # export EDITOR='mvim' # fi # Compilation flags # export ARCHFLAGS="-arch x86_64" # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh # users are encouraged to define aliases within the ZSH_CUSTOM folder. # For a full list of active aliases, run `alias`. # # Example aliases # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh"
安装powerline-status:
pip install powerline-status --user
期间遇到:
【已解决】macOS中pip安装powerline-status报错:WARNING Retrying Retry total 4 after connection broken by ConnectTimeoutError
继续:

➜ ~ git clone https://github.com/powerline/fonts.git --depth=1 Cloning into 'fonts'... remote: Enumerating objects: 310, done. remote: Counting objects: 100% (310/310), done. remote: Compressing objects: 100% (236/236), done. Receiving objects: 7% (23/310), 1.28 MiB | 15.00 KiB/s
git下载速度太慢
所以要去想办法给macOS中git加速,比如加上代理:
【已解决】Win中VMWare中macOS给git加上代理加速GitHub仓库下载
继续:

可以设置字体了。


关于git加代理后的心得:
有时候会报错,多次几次,或许就好了:
➜ temp git clone https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git Cloning into 'oh-my-zsh-agnoster-fcamblor'... error: RPC failed; curl 35 LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 fatal: the remote end hung up unexpectedly ➜ temp git clone https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor.git Cloning into 'oh-my-zsh-agnoster-fcamblor'... remote: Enumerating objects: 136, done. remote: Total 136 (delta 0), reused 0 (delta 0), pack-reused 136 Receiving objects: 100% (136/136), 1.14 MiB | 741.00 KiB/s, done. Resolving deltas: 100% (59/59), done.
此时:并没有改动代理服务器节点,多试了一次,就又好了。

把主题改为 agnoster

效果就出来了。
再去安装高亮插件
cd ~/.oh-my-zsh/custom/plugins/ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git vi ~/.zshrc
编辑为
plugins=( git zsh-syntax-highlighting )

plugins=( git zsh-autosuggestions zsh-syntax-highlighting )

还是这个 auto suggestions好用:
能自动补全,很方便。
【总结】
至此,安装了iTerm2,还安装了主题,颜色,字体
尤其是几个插件:
- zsh-autosuggestions
- 极其推荐安装
- 作用和效果:方便命令自动补全
- 只需要输入一部分最近的某个命令,按一下右箭头→,即可全部输入,非常方便
- zsh-syntax-highlighting
- 非常推荐
- 作用和效果:如上图,效果很炫
- 分段显示不同颜色,容易区分出终端中的命令和内容