Install ZSH (oh my zsh) on ubuntu 20.04

Install ZSH (oh my zsh) on ubuntu 20.04,第1张

Install ZSH (oh my zsh) on ubuntu 20.04 1.Prerequisites
  • Zsh should be installed (v4.3.9 or more recent is fine but we prefer 5.0.8 and newer).
  • If not pre-installed (run zsh --version to /confirm/i), check the following wiki instructions here: Installing ZSH
  • curl or wget should be installed by
    pip install wget
  • git should be installed (recommended v2.4.11 or higher)  by
    apt install git-all
  • Basic Installation
  • Oh My Zsh is installed by running one of the following commands in your terminal. You can install this via the command-line with either curl, wget or another similar tool.
  • curlsh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"wgetsh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
 # 利用码云的安装方法
sh -c "$(wget -O- https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"
​

2. 插件
  • 安装incr自动补全插件推荐

cd ~/.oh-my-zsh/plugins/
mkdir incr && cd incr
wget http://mimosa-pudica.net/src/incr-0.2.zsh
nano ~/.zshrc 

source ~/.oh-my-zsh/plugins/incr/incr*.zsh    (add in the ~/.zshrc)

 

source ~/.zshrc

  • 直接使用的插件推荐
nano ~/.zshrc

plugins=(git extract z)      (add in the ~/.zshrc)

 

source ~/.zshrc

  • git

默认开启的插件,提供了大量 git 的alias.

  • extract

功能强大的解压插件,所有类型的文件解压一个命令x全搞定,再也不需要去记tar后面到底是哪几个参数了.

  • z

强大的目录自动跳转命令,会记忆你曾经进入过的目录,用模糊匹配快速进入你想要的目录.

3. 主题

nano ~/.zshrc

eg: 

  • ZSH_THEME="robbyrussell" default

  • 如果ZSH_THEME=""则不启用任何主题.

  • 如果ZSH_THEME="random",那么每次打开一个新的终端窗口时,电脑会随机选择一个主题使用,echo $RANDOM_THEME可输出当前主题名称.

source ~/.zshrc

参阅:oh-my-zsh主题、更多主题


 卸载 Oh My Zsh
  • 终端输入 :
uninstall_oh_my_zsh
Are you sure you want to remove Oh My Zsh? [y/N]  Y
  • 终端提示信息:
Removing ~/.oh-my-zsh
Looking for original zsh config...
Found ~/.zshrc.pre-oh-my-zsh -- Restoring to ~/.zshrc
Found ~/.zshrc -- Renaming to ~/.zshrc.omz-uninstalled-20170820200007
Your original zsh config was restored. Please restart your session.
Thanks for trying out Oh My Zsh. It's been uninstalled.

 

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5503833.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-13
下一篇 2022-12-13

发表评论

登录后才能评论

评论列表(0条)

保存