安装git和zsh

sudo apt-get install git zsh

安装ohmyzsh

官方安装说明,官方给的命令本质上为下载源代码至~/.oh-my-zh目录。

因为github连接常常发生中断,以下使用hub.fastgit.org镜像站进行下载安装,也可直接下载ZIP文件。

(base)
# sky @ DESKTOP-NJJGMD8 in ~/github [19:04:15]
$ git clone https://hub.fastgit.org/ohmyzsh/ohmyzsh.git
Cloning into 'ohmyzsh'...
remote: Enumerating objects: 26382, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 26382 (delta 3), reused 8 (delta 1), pack-reused 26369
Receiving objects: 100% (26382/26382), 7.70 MiB | 800.00 KiB/s, done.
Resolving deltas: 100% (13229/13229), done.

安装常用的插件(可跳过)

https://github.com/zsh-users

本质为下载插件源代码至ohmyzsh/pluginsohmyzsh/custom/plugins目录

此处分别下载zsh-autosuggestionszsh-syntax-highlighting

(base)
# sky @ DESKTOP-NJJGMD8 in ~/github on git:master o [19:06:42]
$ cd ohmyzsh/custom/plugins
(base)
# sky @ DESKTOP-NJJGMD8 in ~/github/ohmyzsh/custom/plugins on git:master o [19:09:06]
$ ls
example
(base)
# sky @ DESKTOP-NJJGMD8 in ~/github/ohmyzsh/custom/plugins on git:master o [19:09:06]
$ git clone https://hub.fastgit.org/zsh-users/zsh-autosuggestions.git
Cloning into 'zsh-autosuggestions'...
remote: Enumerating objects: 2435, done.
remote: Counting objects: 100% (50/50), done.
remote: Compressing objects: 100% (40/40), done.
remote: Total 2435 (delta 21), reused 22 (delta 9), pack-reused 2385
Receiving objects: 100% (2435/2435), 566.34 KiB | 276.00 KiB/s, done.
Resolving deltas: 100% (1552/1552), done.
(base)
# sky @ DESKTOP-NJJGMD8 in ~/github/ohmyzsh/custom/plugins on git:master o [19:10:45] C:130
$ git clone https://hub.fastgit.org/zsh-users/zsh-syntax-highlighting.git
Cloning into 'zsh-syntax-highlighting'...
remote: Enumerating objects: 6943, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 6943 (delta 10), reused 20 (delta 5), pack-reused 6913
Receiving objects: 100% (6943/6943), 1.49 MiB | 98.00 KiB/s, done.
Resolving deltas: 100% (4685/4685), done.
(base)
# sky @ DESKTOP-NJJGMD8 in ~/github/ohmyzsh/custom/plugins on git:master o [19:11:56]
$ ls
example  zsh-autosuggestions  zsh-syntax-highlighting

修改.zshrc文件

拷贝模板文件至~/.zshrc

# sky @ DESKTOP-NJJGMD8 in ~/github/ohmyzsh on git:master o [19:47:25]
$ cp templates/zshrc.zsh-template ~/.zshrc

修改~/.zshrc文件

  • ZSH对应的路径:export ZSH=/home/sky/github/ohmyzsh

  • 添加插件(可跳过):plugins=(git z zsh-autosuggestions zsh-syntax-highlighting)

其中zsh-syntax-highlighting需执行以下命令在.zshrc的末尾添加激活命令

# sky @ DESKTOP-NJJGMD8 in ~/github/ohmyzsh/custom/plugins on git:master o [20:21:59]
$ echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc

~/.zshrc

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH# Path to your oh-my-zsh installation.
# export ZSH=$HOME/.oh-my-zsh
export ZSH=/home/sky/github/ohmyzsh# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="ys"# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"# 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 disable colors in ls.
# DISABLE_LS_COLORS="true"# Uncomment the following line to disable auto-setting terminal title.
# 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 set 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# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git z zsh-autosuggestions zsh-syntax-highlighting)source $ZSH/oh-my-zsh.sh# User configuration# export MANPATH="/usr/local/man:$MANPATH"# You may need to manually set your language environment
# export LANG=en_US.UTF-8# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi# Compilation flags
# export ARCHFLAGS="-arch x86_64"# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"source /home/sky/github/ohmyzsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

激活zsh

(base) sky@DESKTOP-NJJGMD8:/mnt/c/Users/strive$ echo $SHELL
/bin/bash
(base) sky@DESKTOP-NJJGMD8:/mnt/c/Users/strive$ zsh
(base)
# sky @ DESKTOP-NJJGMD8 in /mnt/c/Users/strive [19:53:47]
$ source ~/.zshrc
(base)
# sky @ DESKTOP-NJJGMD8 in /mnt/c/Users/strive [19:53:51]
$

修改默认shell

(base)
# sky @ DESKTOP-NJJGMD8 in /mnt/c/Users/strive [19:56:07]
$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/usr/bin/bash
/bin/rbash
/usr/bin/rbash
/bin/dash
/usr/bin/dash
/usr/bin/tmux
/usr/bin/screen
/bin/zsh
/usr/bin/zsh
(base)
# sky @ DESKTOP-NJJGMD8 in /mnt/c/Users/strive [19:54:21]
$ chsh -s /bin/zsh
Password:
(base)
# sky @ DESKTOP-NJJGMD8 in /mnt/c/Users/strive [19:55:19]
$

Ubuntu安装ohmyzsh相关推荐

  1. ubuntu安装zsh、oh-my-zsh及常用配置

    ubuntu安装zsh.oh-my-zsh及常用配置 目前,ubuntu默认的shell是bash,但还有一种shell,叫做zsh它比bash更加强大,功能也更加完善,zsh虽说功能强大,但是配置比 ...

  2. centos,ubuntu,linuxmit安装oh-my-zsh

    安装oh-my-zsh 一.安装zsh和oh-my-zsh 1.1 查看当前shell 1.2 安装zsh 1.3 查看系统中已经安装的shell 二.配置和优oh-my-zsh 2.1 修改主题 2 ...

  3. Linux: Wsl ubuntu下安装OhMyZsh

    人神都知道OhMyZsh的魔力,那就上吧.当然有人喜欢fish,各有各的好. 环境:WSL2, unbuntu 18.04 一.安装ZSH (1) 安装 sudo apt-get install -y ...

  4. ubuntu 安装GPU黑屏 修改GRUB_Ubuntu 18.04 安装笔记

    概述:Ubuntu 18.04 的安装配置笔记, :two_hearts:. 简介:基础使用环境的搭建,暂定目标为一篇文章解决大部分疑问. 协议:本文章使用 CC BY-NC-SA 4.0 协议(转载 ...

  5. ubuntu安装zsh及环境配置

    ubuntu安装zsh及环境配置 MacBook 安装 zsh 个人很喜欢使用zsh,它的终端显示很清晰,命令都很友好,使用git时,直接可以看到当前分支和修改状态 zsh安装 1.查看当前系统装了哪 ...

  6. linux 换源 以及 安装ohmyzsh

    1.sudo cp /etc/apt/sources.list  /etc/apt/sources_init.list 2.sudo rm /etc/apt/sources.list 2.vim /e ...

  7. Ubuntu安装MongoDB

    https://jingyan.baidu.com/article/e5c39bf5f5ddd539d76033a9.html Ubuntu安装MongoDB4.0: https://www.jian ...

  8. ubuntu安装OpenCV详细教程(建议收藏)

    记录一篇"如何安装ubuntu下C++接口的opencv"的文章.由于转载格式有问题,直接贴个链接:ubuntu安装opencv的正确方法 注意:本人根据此博客安装遇到的问题:2. ...

  9. Linux/ubuntu 安装 redis 4.0报错解决:redis-server.service: Can't open PID file /var/run/redis/redis-server.

    此文首发于我的个人博客:Linux/ubuntu 安装 redis 4.0报错解决:redis-server.service: Can't open PID file /var/run/redis/r ...

最新文章

  1. jQuery插件:jqGrid使用(二)
  2. 平台游戏中走与跳的实现
  3. docker入门之容器网络
  4. arcgis mxt模板 创建工具条无法保存_【从零开始学GIS】ArcGIS中的绘图基本操作(二)...
  5. Java中的常量Constant
  6. P3160 [CQOI2012]局部极小值
  7. 跑步是冻龄,还是催人老?
  8. JavaScript函数的arguments(2)
  9. 那些唱衰智能电视的砖家们可以闭嘴了
  10. iphone怎么长截屏_涨知识了!原来苹果手机也可以长截屏,还不知道的,快来学一学...
  11. ARM指令集详解(超详细!带实例!)
  12. 在Xperia XZ上刷入AOSP
  13. Android 11.0 app添加校验锁(输入密码才能进入app)
  14. 马斯克的底层思维方式
  15. java和python爬虫那个好_java和python在爬虫方面的优势和劣势是什么?
  16. 明尼苏达大学双城分校计算机科学,UMN的CS「明尼苏达大学双城分校计算机科学与工程系」...
  17. 网页版 Facebook 第三方登录示例 Facebook网页登录
  18. android api 和版本对应表汇总
  19. Establishing SSL
  20. 阿里云账号个人实名认证教程

热门文章

  1. 智能OCR文字识别训练平台
  2. 2022电工(高级)考试题库及模拟考试
  3. ROS2常见问题及解决方案
  4. Unity中的Prefab Variant
  5. Unity中如何制作预制件(prefab)
  6. 浅析DDOS攻击及防御
  7. matlab构造核函数,matlab常用核函数
  8. Linux系统启动过程
  9. 模电笔记9 差分放大电路
  10. 黑猴子的家:Redis 薪火相传