mac环境变量不生效问题
1.在 ~/.zshrc 中添加
source ~/.bash_profile
参考:https://blog.csdn.net/qq_18505715/article/details/83276208
2.比如mac的git命令补全不生效,可以参考如下文章添加
https://blog.csdn.net/WinWill2012/article/details/71774461
source ~/.git-completion.bash
3.调整mac终端颜色和全路径显示
export PS1="%n@%m %0~ $ " export CLICOLOR=1 export LSCOLORS=ExFxBxDxCxegedabagacad alias ls='ls -GFh'
如果安装的oh my zsh,那么修改全路径显示的方式是
vim ~/.oh-my-zsh/themes/robbyrussell.zsh-theme
修改成
#PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' PROMPT+='${ret_status} %{$fg[cyan]%}%d%{$reset_color%} $(git_prompt_info)$ '
就会变成
4.Big Sur在使用mvn package的时候回遇到
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
解决方法是在~/.bash_profile中加入
#java export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH # maven export M2_HOME=/Users/lintong/software/apache-maven-3.6.3 export M2=$M2_HOME/bin export PATH=$M2:$PATH
5.iterm2连接远程终端中文乱码,在 ~/.zshrc 中添加
export LANG='UTC-8' export LC_ALL='en_US.UTF-8'
然后
source ~/.zshrc
6.oh my zsh添加提示插件
https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md
本文只发表于博客园和tonglin0325的博客,作者:tonglin0325,转载请注明原文链接:https://www.cnblogs.com/tonglin0325/p/12314122.html