zsh

快速安装

# 使用 curl
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# 或者使用 wget
$ sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

配置主题

从官网中可以预览各种主题,见 https://github.com/robbyrussell/oh-my-zsh/wiki/Themes。配置主题只需按一下步骤

# 1)修改 ZSH_THEME 值为想要设置的主题,允许无主题
$ vim ~/.zshrc
# 2)使配置生效
$ source ~/.zshrc

禁止粘贴命令时自动对特殊字符进行转义

(1)编辑 misc.zsh 文件

vim  ~/.oh-my-zsh/lib/misc.zsh

(2)注释掉 url-quote-magic

#if [[ $ZSH_VERSION != 5.1.1 ]]; then
#  for d in $fpath; do
#       if [[ -e "$d/url-quote-magic" ]]; then
#               if is-at-least 5.1; then
#                       autoload -Uz bracketed-paste-magic
#                       zle -N bracketed-paste bracketed-paste-magic
#               fi
#               autoload -Uz url-quote-magic
#               zle -N self-insert url-quote-magic
#      break
#       fi
#  done
#fi

解决中文乱码

~/.zshrc添加

export LC_ALL=en_US.UTF-8  
export LANG=en_US.UTF-8

然后执行

source ~/.zshrc

更换系统默认的 shell 为 zsh

$ chsh -s /bin/zsh

使用 highlight 插件

brew install zsh-syntax-highlighting

无法手动更新 zsh

$cd .oh-my-zsh/ ( to change to its root directory)
$git status (now you should be in your oh-my-zsh root with master on it and do git status)
$git stash/git add . (to stash the changes and head back to master/add the changes)
$git commit -m (if you decided to add the changes)
$upgrade_oh_my_zsh (you can now upgrade)

转载于:https://www.cnblogs.com/lshare/p/11334760.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值