zsh资源记录

7 篇文章 0 订阅

zsh资源记录

安装zsh和相关插件

# 1.zsh
brew install zsh
chsh -s /bin/zsh
#@ oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 2. themes
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
## modify .zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"
# 3. plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

## modify .zshrc 
plugins=(
    # other plugins...
    zsh-autosuggestions  # 插件之间使用空格隔开
    zsh-syntax-highlighting
    z
)

设置prompt

# 使用了p10k theme的话, 设置更短的prompt, 再~/.p10k.zsh中, 修改如下的行
# 原: typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80, (如果没有该行,先执行p10k configure生成完整配置)修改为
typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=0
# 设置ctrl+u删除光标到行首的字符,在macos中是win + backspace
# 参考:https://stackoverflow.com/questions/44846908/how-to-delete-from-current-position-to-the-beginning-of-the-line
bindkey \^U backward-kill-line to your .zshrc
unsetopt autopushd  # 防止自动将目录pushd到stack

参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值