linux_zsh/oh my zsh 版本检查/使用帮助(check and update)/安装最新版zsh

zsh/oh my zsh check and update/安装最新版zsh

最近感觉zsh+oh my zsh 有点bug,ctrl+c无法结束输入,而且容易卡死,遂打算更新以下zsh

zsh version

  • zsh --version
oh my zsh update config

手动更新

  • omz update

oh my zsh document

install zsh

oh my zsh basic usage and help
  • omzcommand
    • omz -hget help
#( 04/12/22@ 2:04PM )( cxxu@cxxuAli ):~
   omz -h
Usage: omz <command> [options]

Available commands:

  help                Print this help message
  changelog           Print the changelog
  plugin <command>    Manage plugins
  pr     <command>    Manage Oh My Zsh Pull Requests
  reload              Reload the current zsh session
  theme  <command>    Manage themes
  update              Update Oh My Zsh
  version             Show the version
二级帮助
#( 04/12/22@ 2:04PM )( cxxu@cxxuAli ):~
   omz version
master (846f417e)
#( 04/12/22@ 2:05PM )( cxxu@cxxuAli ):~
   omz plugin
Usage: omz plugin <command> [options]

Available commands:

  disable <plugin> Disable plugin(s)
  enable <plugin>  Enable plugin(s)
  info <plugin>    Get information of a plugin
  list             List all available Oh My Zsh plugins
  load <plugin>    Load plugin(s)

z shell通用方案安装/更新到最新版zsh:Install zsh by source code(general method)

referneces

方案一(自动化)
#!/bin/sh​
# Build Zsh from sources on Ubuntu
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.

git clone git://zsh.git.sf.net/gitroot/zsh/zsh

cd zsh

#上面获取zsh原码的方式可到官网下载压缩包解压来代替

# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo

./Util/preconfig

# Options from Ubuntu Zsh package rules file (http://launchpad.net/ubuntu/+source/zsh)
./configure --prefix=/usr \
            --mandir=/usr/share/man \
            --bindir=/bin \
            --infodir=/usr/share/info \
            --enable-maildir-support \
            --enable-max-jobtable-size=256 \
            --enable-etcdir=/etc/zsh \
            --enable-function-subdirs \
            --enable-site-fndir=/usr/local/share/zsh/site-functions \
            --enable-fndir=/usr/share/zsh/functions \
            --with-tcsetpgrp \
            --with-term-lib="ncursesw" \
            --enable-cap \
            --enable-pcre \
            --enable-readnullcmd=pager \
            --enable-custom-patchlevel=Debian \
            LDFLAGS="-Wl,--as-needed -g"

make

make check

sudo make install

sudo make install.info
方案二(手动操作)

手动操作提取官方包的文件(解压拆包)

  • tar xvf zsh-5.8.1.tar.xz zsh-5.8.1/
    • 根据自己的版本切换数字
    • 根据INSTALL文件描述安装

安装完毕检查版本

我从5.4.1->5.8.1

#( 04/12/22@ 1:50PM )( cxxu@cxxuAli ):~
   type zsh
zsh is /usr/bin/zsh
#( 04/12/22@ 1:51PM )( cxxu@cxxuAli ):~
   /usr/bin/zsh --version
zsh 5.8.1 (x86_64-pc-linux-gnu)
如果你之前备份过你的配置文件,你可以尝试从备份文件中恢复你的环境变量配置。如果没有备份文件,你可以尝试查看你的历史命令,看看你之前是如何配置环境变量的。你也可以尝试通过以下步骤来恢复默认的zsh配置文件: 1. 打开终端,进入你的home目录。 2. 打开.zshrc文件,如果没有该文件,可以使用以下命令创建该文件:touch .zshrc 3. 复制以下内容到.zshrc文件中: ``` # Path to your oh-my-zsh installation. export ZSH="/Users/your-username/.oh-my-zsh" # Set the default shell to zsh export SHELL=$(which zsh) [ -z "$ZSH_VERSION" ] && exec "$SHELL" -l # Uncomment following line if you want to disable colors in ls # export DISABLE_LS_COLORS="true" # Uncomment the following line to disable auto-setting terminal title. # export DISABLE_AUTO_TITLE="true" # Uncomment the following line to enable command auto-correction. # ENABLE_CORRECTION="true" # Uncomment the following line to display red dots whilst waiting for completion. # COMPLETION_WAITING_DOTS="true" # Uncomment the following line if you want to disable marking untracked files under # VCS as dirty. This makes repository status check for large repositories much, # much faster. # DISABLE_UNTRACKED_FILES_DIRTY="true" # Uncomment the following line if you want to change the command execution time # stamp shown in the history command output. # You can specify one of the optional three formats: # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" # or set a custom format using the strftime function format specifications, # see 'man strftime' for details. # HIST_STAMPS="mm/dd/yyyy" # Would you like to use another custom folder than $ZSH/custom? # ZSH_CUSTOM=/path/to/new-custom-folder # Uncomment the following lines to use case-sensitive completion. # CASE_SENSITIVE="true" # zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # Uncomment the following line to use hyphen-insensitive completion. Case # sensitive completion must be off. _ and - will be interchangeable. # HYPHEN_INSENSITIVE="true" # Uncomment the following line to disable bi-weekly auto-update checks. # DISABLE_AUTO_UPDATE="true" # Uncomment the following line to automatically update without prompting. # DISABLE_UPDATE_PROMPT="true" # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 # Uncomment the following line if pasting URLs and other text is messed up. # DISABLE_MAGIC_FUNCTIONS=true # Uncomment the following line to enable syntax highlighting # ENABLE_CORRECTION="true" # HIGHLIGHT_STYLE="auto" ``` 4. 保存文件,退出终端后再重新打开即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cxxu1375

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值