oh my zsh 安装
date: "2020-10-18T12:36:00+08:00"
title: "oh my zsh 安装"
tags: ["zsh","oh my zsh"]
categories: ["shell"]
官网地址
oh my zsh: https://ohmyz.sh/
oh my zsh github 地址: https://github.com/ohmyzsh/ohmyzsh/wiki
zsh github地址: https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
oh my zsh 主题: https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
oh my zsh 插件: https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins
安装zsh
mac系统
zsh --version
brew install zsh zsh-completions
centos
sudo yum update && sudo yum -y install zsh
ubuntu
apt install zsh
https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
安装 oh my zsh
curl 方式安装
sh -c“ $(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)”
wget 方式安装
sh -c“ $(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O-)”
切换为zsh
查看系统支持的shell
cat /etc/shells
查看当前shell
echo $SHELL
chsh -s /usr/local/bin/zsh
或者
chsh -s /bin/zsh
切换后要新打开terminal才会生效
配置主题和插件
题外话,由于clear每次打的很麻烦,可以直接使用ctrl+L清屏,和clear等效。
First:
安装好zsh和oh-my-zsh
Second:
接下来就可以开始享受了
主题:cloud 这个云朵看上去挺舒服的~~
另外一个主题就是 crunch,也是我目前在用的一个主题
设置方法:vim ~/.zshrc, 找到ZSH_THEME=“”,这句话,在双引号里面写上cloud就可以啦!
如果你在里面写的是random,每次开启终端的主题将是随机的!
当然你也可以自己找主题,oh-my-zsh里面带有主题了,主题都在以下这个文件夹里,可以进去找自己喜欢的
~/.oh-my-zsh/themes
插件:
1、git
2、pip
这两个没什么讲的
3、sudo
当我们输入命令需要管理员身份时,不必让光标回到开始打一个sudo,可以直接按两次ESC,就会自动帮你加上sudo
4、thefuck
当我们输入命令错误时,输入fuck,终端就会乖乖的给我们正确的指令选择了!(这个插件需要自己下
5、autojump
在终端输入d,可以显示刚刚走过的路径,然后按数字选择进入哪一个目录。(这个插件需要自己下
6、web-search
直接在终端使用浏览器搜索,可以百度 谷歌
7、last-working-dir
可以记录我退出终端时所在的路径,再次打开时还在这个路径
8、zsh-syntax-highlighting
shell下的语法高亮,(这个也要自己下,命令如下)
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
除了以上的两个插件需要自己下载,其他都不需要的。
设置方法:vim ~/.zshrc 在里面找到plugins=()
然后在括号里加上想要的插件就可以了。
plugins=(
git
pip
sudo
thefuck
autojump
web-search
last-working-dir
zsh-syntax-highlighting
)
以上步骤操作完后,重启终端,输入source .zshrc,就ok了!
注意每次添加插件以后,都要进行source .zshrc一下,让这些插件运行起来。
另外,我的截图软件的scrot,查看图片是用gwenview
scrot -s:可以自己选择截图的范围
一下是我的 .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/jiaaaaaaaqi/.oh-my-zsh"
# 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/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="cloud"
# 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 ~/.oh-my-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 change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# 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 ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
pip
sudo
thefuck
autojump
web-search
last-working-dir
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"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# 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"
oh my zsh 安装的更多相关文章
- Zsh安装CMake补全脚本进行CMake命令补全
最近在尝试使用Zsh,发现其补全命令的功能相当厉害.但对CMake命令的补全在默认的5.0.5中好像没有看到,网上找了下关于配置Zsh补全的文章也没有多少. 于是自己动手,发现在Zsh安装目录 ...
- 树莓派进阶之路 (035) - 基于linux的zsh安装脚本
基于linux的zsh安装脚本: Ubuntu版本: #!/bin/sh cd #安装zsh sudo apt-get install zsh #查看zsh cat /etc/shells #更改zs ...
- 一文搞定 Windows Terminal 设置与 zsh 安装 (非WSL)
为 Windows Terminal 添加标签页 添加 Anaconda 标签页 在settings.json文件中的list列表中添加设置项: { // Make changes here to t ...
- Zsh安装
Zsh 使用 Homebrew 完成 zsh 和 zsh completions 的安装 brew install zsh zsh-completions 安装 oh-my-zsh 让 zsh 获得拓 ...
- Zsh安装及常用操作
Zsh因为插件丰富而闻名,但是 zsh 的默认配置及其复杂繁琐,让人望而却步,直到有了oh-my-zsh这个开源项目,让zsh配置降到0门槛.而且它完全兼容 bash. 安装Zsh: [root@lo ...
- 树莓派进阶之路 (005) - 树莓派Zsh安装脚本(原创)
zsh.sh #!/bin/bash cd #安装zsh sudo apt-get install zsh #查看zsh cat /etc/shells #更改zsh chsh -s /bin/zsh ...
- zsh 安装powerline 主题特效
查看当前使用的shell脚本是哪一种 echo $0 1. 安装Powerline 使用pip指令,安装方法: pip install powerline-status 如果没有,则先 ...
- MAC-Zsh安装与使用——终极Shell
前言:Zsh可配置性强,用户可以自定义配置,个性化强.Zsh tab补全更强大,该功能可以让我们节约很多时间.Zsh 还有代码高亮功能,使得代码更好看了,显得逼格更高.Zsh 还有很多强大的功能,这里 ...
- oh my zsh安装
引言 最近阿里云搞活动,整了一台服务器,作为Linux的爱好者,又免费,so.......当然不能错过了.以前看到好多炫酷的Linux界面,比如这样的:梦想中…… 通过各种方式得知这是Oh my zs ...
随机推荐
- 【NOIP2015模拟】终章-剑之魂
背景介绍 古堡,暗鸦,斜阳,和深渊-- 等了三年,我独自一人,终于来到了这里-- "终焉的试炼吗?就在这里吗?"我自言自语道. "终焉的试炼啊!就在这里啊!"我 ...
- Solr专题(四)Solr安全设置
因为solr的admin界面默认只需要知道ip和端口就能直接访问,如果被别有用心的人盯上就很容易给你的系统带来重大的破坏,所以我们应该限制访问. 请注意本例使用的是Solr7. Solr集成了以下几 ...
- mongodb3.4.5用http访问28017端口
4.要想用28017去访问,百度说必须开启http服务 4.1.前提: windows下安装mongodb必须装在没有中文和空格的目录下,我直接装在了D盘根目录 删掉MongoDB\Server\3. ...
- [SpringBoot项目]笔记
request&response 重定向(跳转) 301 永久跳转/302 临时跳转 工业用途 通过url判断来自手机页面,就跳转到手机对应的页面. 活动页面临时改url? 异常处理 定义一个 ...
- .NET 5.0 RC1 发布,离正式版发布仅剩两个版本
原文:http://dwz.win/Qf8 作者:Richard 翻译:精致码农-王亮 说明:1. 本译文并不是完全逐句翻译的,存在部分语句我实在不知道如何翻译或组织就根据个人理解用自己的话表述了.2 ...
- 不再用上官网,自己部署一套ElementUI官方最新文档
ElementUI官方的访问速度一直很慢,公司内网也无法进行外网访问.故研究了下最新的ElementUI API(2.13.2)部署教程. 先上效果图 ElementUI文档部署过程 到github下 ...
- Spock测试套件入门
目录 Spock测试套件 核心概念 整体认识 前置.后置 同junit的类比 Feature 方法 blocks 典型的用法 异常condition then和expect的区别 cleanup bl ...
- Springboot+Vue实现仿百度搜索自动提示框匹配查询功能
案例功能效果图 前端初始页面 输入搜索信息页面 点击查询结果页面 环境介绍 前端:vue 后端:springboot jdk:1.8及以上 数据库:mysql 核心代码介绍 TypeCtrler .j ...
- Class对象、反射、动态代理
Class对象是所有类的根源,Object是所有对象的根源. 编译后的新类会产生一个Class对象,保存在同名的.class文件中.每个类都有一个Class对象,它包含了所有的与类有关的信息.所有的C ...
- Linux基本目录机构
Linux基本目录机构 1. 基本介绍 Linux的文件系统采用级层式子的树状目录结构 最上层是根目录"/" Linux世界里,一切皆文件 2. 目录用途 /bin: 是Binar ...