最好用的shell-ohmyzsh

至今用的macOS里最好的 shell,没有之一。首先你要安装iterm2,然后再安装这个,iterm2安装自行google

安装直接跑这里open in new window的命令

vi ~/.zshrc

推荐主题

ys

ZSH_THEME="ys"

简单,如用户名路径时间等都有,关键的是还有git状态,就是下面o符号

# Manfredhu @ Manfredhu-MB1 in ~/Documents/Manfredhu on git:Manfredhu_release o [13:14:03]

推荐插件

plugins=(
  git
  autojump
  last-working-dir
  zsh-syntax-highlighting
  zsh-autosuggestions
)

autojumpopen in new window

记录命令,自动补全,灰常好用,推荐。直接brew就可以装了,会根据目录权重排序,保证你进入的是高频访问的目录

brew install autojump
  • j foo 直接跳转目录
  • jc bar 跳转子目录
  • jo music finder访达打开文件夹music
  • jco images finder访达打开子文件夹images

zsh-syntax-highlightingopen in new window

高亮语法用

# https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

zsh-autosuggestionsopen in new window

# https://github.com/zsh-users/zsh-autosuggestions/blob/master/INSTALL.md
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

命令预览,有了这个不怕你不会敲命令,而是怕你敲的太快了。一般熟练后无脑Control + e快进效率就很高了

.zshrc

如果切换到zsh原来终端的一些命令不会执行,这里强制zsh关联一下一些命令(通常是软件加入全局环境变量的命令,比如mysql,redis-cli等等,还有你的自定义alias

.bashrc and .bash_profile

source ~/.bash_profile
source ~/.bashrc

nvm

# nvm
export NVM_DIR="$HOME/.nvm"
  [ -s "/usr/local/opt/nvm/nvm.sh" ] && \. "/usr/local/opt/nvm/nvm.sh"  # This loads nvm
  [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/usr/local/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion
Last Updated:
<manfred>峯</hu>
欢迎关注微信公众号 【Big前端】无广告,无软文,就是这么傲娇。直推一线大厂高质量内容,不局限于前端·后台·运维相关,还包括房价🏠、信用卡💳等内容也可内推一线大厂腾讯阿里字节,对腾讯字节比较熟悉,简历可以发给我,我会给你介绍一线大厂的情况,让你更加了解一线大厂