mac系統vscode環境配置,以及iTerm2配置Zsh + on-my-zsh shell


https://segmentfault.com/a/1190000013612471?utm_source=tag-newest

https://ohmyz.sh/

 一:安裝iTerm2終端

 https://www.iterm2.com/downloads.html

1:查看當前的shell環境

echo $SHELL

2: 查看系統自帶哪些shell

cat /etc/shells

3:切換Zsh shell

chsh -s /bin/zsh
# Mac如下
# 在 /etc/shells 文件中加入如下一行
/usr/local/bin/zsh
# 接着運行
chsh -s /usr/local/bin/zsh

 自動安裝oh-my-zsh 插件

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

 

重啟iTerm2終端

效果

 

二:vscode中配置shell

 

vscode中字體及顏色的配置:

{
    "editor.fontSize": 14,
    "editor.tabSize": 2,
    "workbench.colorTheme": "Monokai",
    "workbench.startupEditor": "newUntitledFile",
    "window.zoomLevel": 1,
    "typescript.check.npmIsInstalled": false,
    "extensions.ignoreRecommendations": true,
    "git.ignoreMissingGitWarning": true,
    "gitlens.advanced.messages": {
        "suppressShowKeyBindingsNotice": true
    },
    "terminal.integrated.shell.linux": "/bin/zsh",
    "terminal.integrated.shell.osx": "/bin/zsh"
}

效果:

 

重啟電腦后發現node,nvm命令都無法識別。

Mac使用zsh shell導致mvn命令無效的解決方案:

1、編輯 .zshrc 文件

vim ~/.zshrc

2、然后在.zshrc文件末尾加上

source ~/.bash_profile

保存退出

3、讓配置文件修改后生效,執行以下命令

source ~/.bash_profile

這樣node,nvm命令就可以識別了。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM