踩了无数的坑所以特意在此总结一下

目录

  • 1、安装git
  • 2、安装zsh
      • ①、clone zsh
    • ②、安装所需要组件
    • ③、安装
    • ⑤、查看
  • 3、安装oh-my-zsh
  • 插件安装
  • 5、安装powerlevel10k
    • ①、安装字体
    • ②、安装p10k

1、安装git

sudo yum install -y git

2、安装zsh

如果你centos版本为7x,那就无法自动安装zsh,后续安装的p10K主题要求的zsh最低版本为5.1,而7x所安装的是5.0;所以在此需要手动编译源码后安装zsh
这里选择zsh 5.8版本

①、clone zsh

我这里是干净的机器所以我就直接克隆,如果你已经安装过zsh了那么需要先删除(yum remove zsh)原来的后再手动安装
git clone -b zsh-5.8 --depth=1 https://github.com/zsh-users/zsh.git temp-zsh

②、安装所需要组件

sudo yum install git make ncurses-devel gcc autoconf man

③、安装

cd temp-zsh
./Util/preconfig
./configure

make

make check

make install

⑤、查看


将/usr/local/bin/zsh加入/etc/shells内
切换bash
chsh -s $(which zsh)

Options For Configure
---------------------The `configure' program accepts many options, not all of which are useful
or relevant to zsh.  To get the complete list of configure options, run
"./configure --help".  The following list should contain most of the
options of interest for configuring zsh.Configuration:--cache-file=FILE     # cache test results in FILE--help                # print a help message--version             # print the version of autoconf that create configure--quiet, --silent     # do not print `checking...' messages--no-create           # do not create output filesDirectories:--prefix=PREFIX       # install host independent files in PREFIX [/usr/local]--exec-prefix=EPREFIX # install host dependent files in EPREFIX [PREFIX]--bindir=DIR          # install user executables in DIR [EPREFIX/bin]--infodir=DIR         # install info documentation in DIR [PREFIX/info]--mandir=DIR          # install man documentation in DIR [PREFIX/man]--srcdir=DIR          # find the sources in DIR [configure dir or ..]--datadir=DATADIR     # install shared files in DATADIR [PREFIX/share]Features:--enable-FEATURE      # enable use of this feature--disable-FEATURE     # disable use of this featureHere is the list of FEATURES currently supported.  Defaults are shown in
brackets, though a value shown as `yes' (equivalent to --enable-FEATURE)
will be ignored if your OS doesn't support that feature.zsh-debug            # compile debugging features into zsh [no]
zsh-mem              # use zsh's memory allocators [no]
zsh-mem-debug        # debug zsh's memory allocators [no]
zsh-mem-warning      # turn on warnings of memory allocation errors [no]
zsh-secure-free      # turn on memory checking of free() [no]
zsh-hash-debug       # turn on debugging of internal hash tables [no]
etcdir=directory     # default directory for global zsh scripts [/etc]
zshenv=pathname      # the path to the global zshenv script [/etc/zshenv]
zshrc=pathname       # the path to the global zshrc script [/etc/zshrc]
zlogin=pathname      # the path to the global zlogin script [/etc/zlogin]
zprofile=pathname    # the path to the global zprofile script [/etc/zprofile]
zlogout=pathname     # the path to the global zlogout script [/etc/zlogout]
fndir=directory      # the directory where shell functions will go# [DATADIR/zsh/VERSION/functions]
site-fndir=directory # the directory where site-specific functions can go# [DATADIR/zsh/site-functions]
additional-path      # add directories to default function path [<none>]
function-subdirs     # if functions will be installed into subdirectories [no]
dynamic              # allow dynamically loaded binary modules [yes]
largefile            # allow configure check for large files [yes]
locale               # allow use of locale library [yes]# 这是.configure不加选项生成的配置
zsh configuration
-----------------
zsh version               : 5.8
host operating system     : x86_64-pc-linux-gnu
source code location      : .
compiler                  : gcc
preprocessor flags        :
executable compiler flags :  -Wall -Wmissing-prototypes -O2
module compiler flags     :  -Wall -Wmissing-prototypes -O2 -fPIC
executable linker flags   :   -s -rdynamic
module linker flags       :   -s -shared
library flags             : -lgdbm -ldl -lncursesw -lrt -lm  -lc
installation basename     : zsh
binary install path       : /usr/local/bin
man page install path     : /usr/local/share/man
info install path         : /usr/local/share/info
functions install path    : /usr/local/share/zsh/5.8/functions
See config.modules for installed modules and functions.

3、安装oh-my-zsh

网上有的博客是直接wget github上的,但是有链接不稳定的情况,所以这里咱么你直接用国内的资源就好
gitee:https://gitee.com/sun_kuo_rui/fonts
这仓库放了安装p10k的所需字体和安装oh-my-zsh所需的install.sh
在这里执行./install.sh
执行完成后出现一下内容证明安装成功

插件安装

zsh-syntax-highlighting :提供了语法高亮显示。
zsh-autosuggestions :它会根据历史记录和完成情况建议您键入的命令,而且快速/不干扰自动提示。
zsh-completions :命令自动补全。

采用国内下载源
git clone https://gitee.com/mo2/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

git clone https://gitee.com/yantaozhao/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

git clone https://gitee.com/wangnd/zsh-completions.git ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions

修改.zshrc


source .zshrc
到这里其实已经比Linux原来的操作界面好看多了,但是zsh虽有好多theme但是还是有些枯燥,所以这里继续安装p10k使终端不在枯燥,提高开发效率

5、安装powerlevel10k

因为咱么手动安装的zsh所以zsh的版本完全符合powerlevel10k的要求。
在安装前需要安装四个powerlevel10k所需字体(我的gitee中有可以直接用https://gitee.com/sun_kuo_rui/fonts.git), 其实安装步骤powerlevel10k git上都有
https://github.com/romkatv/powerlevel10k

①、安装字体

执行完该指令后就可以看到fonts和fontconfig目录了(有的服务器可能没带所以需要安装)
yum -y install fontconfig
将字体上传此目录
cd /usr/share/fonts/

刷新内存中的字体缓存,这样就不用reboot重启了
fc-cache
fc-list查看是否安装成功

②、安装p10k

git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git KaTeX parse error: Expected '}', got 'EOF' at end of input: {ZSH_CUSTOM:-HOME/.oh-my-zsh/custom}/themes/powerlevel10k
修改.zshrc中的theme Set ZSH_THEME=“powerlevel10k/powerlevel10k” in ~/.zshrc.

source ./zshrc
下面按照引导慢慢配置就好了,主要是一些p10k风格的问题
完成拉
还可以通过修改.p10k.zsh来拓展powerlevel10k的样式,将内容直接复制翻译就明白了每个代表了啥意思了,修改完后记得source .zshrc

Linux Centos7.6下安装zsh、oh-my-zsh、powerlevel10k美化终端相关推荐

  1. mysql linux centos7_MySQL在Linux centos7环境下安装教程详解(图)

    这篇文章主要为大家详细介绍了Linux centos7环境下MySQL安装教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 Linux centos7环境下安装MySQL步骤的详细介绍 安装My ...

  2. Linux Centos7.x下安装部署Jira和confluence以及破解方法详述

    https://www.cnblogs.com/easonscx/p/10629173.html Linux Centos7.x下安装部署Jira和confluence以及破解方法详述 简述 JIRA ...

  3. tomcat7.0.81 linux,Linux/CentOS7.0下安装配置Tomcat8.0

    Linux/CentOS7.0下安装配置Tomcat8.0 一.配置Tomcat安装环境 1.下载对应的jdk 我用的是64位的下载地址: 下载将jdk加压后放到/usr/local目录下: 2.建立 ...

  4. newton版本linux,centos7.4下安装部署openstack newton版本 互联网技术圈 互联网技术圈...

    好消息OpenStack的爱好者,最新版本的OpenStack" Newton"已经发布了2016年10月6日,这是OpenStack的第14版本(开源云软件).以下是此版本中已注 ...

  5. linux centos7 mysql_Linux centos7环境下安装MySQL的步骤详解

    Linux centos7环境下安装MySQL的步骤详解 安装MySQL mysql 有两个跟windows不同的地方 1).my.ini 保存到/etc/my.ini 2).用户权限,单独用户执行 ...

  6. linux centos7安装ngix,centos7 环境下安装nginx--Linux

    本文将要为您介绍的是centos7 环境下安装nginx--Linux,具体完成步骤:一.安装前需要的编译环境准备 1.安装make yum install -y gcc automake autoc ...

  7. 【CNMP系列】CentOS7.0下安装Nginx服务

    [CNMP系列]CentOS7.0下安装Nginx服务 话步前言,CNMP之路,系统起步:http://www.cnblogs.com/riverdubu/p/6425028.html 这回我来讲解下 ...

  8. Red Hat (Centos7) 下安装最新 FFmpeg

    Red Hat (Centos7) 下安装最新 ffmpeg FFmpeg既是一款音视频编解码工具,同时也是一组音视频编解码开发套件,作为编解码开发套件,它为开发者提供了丰富的音视频处理的调用接口. ...

  9. CentOS7.5下安装Mycat连接MySQL8.0

    CentOS7.5下安装Mycat连接MySQL8.0 Posted on 2018-11-08 11:07 许爱琪 阅读(645) 评论(2) 编辑 收藏 MyCat详细介绍,请参考https:// ...

最新文章

  1. cms php vue 开源_骑士CMS文件包含+getshell
  2. 用matlab求解工作时间调度问题,置换流水车间调度问题的MATLAB求解.doc
  3. 【华为云技术分享】从 Cloud 1.0 到 2.0,云计算的“多元架构命题”
  4. windows server疑难杂症
  5. 物联网形势大好,传感器前景可观
  6. java jackson_Jackson 框架的高阶应用
  7. VBS 控制 Windos 系统音量 及视频播放
  8. Mysql 数据库/表 备份 与 还原
  9. WordPress仿站实战教程
  10. Java 编程技术中汉字问题的分析及解决
  11. 财会法规与职业道德【5】
  12. 第157篇 合约安全-随机数
  13. adb连接夜神模拟器和连接夜神多开的方法
  14. 【Java】并发模式
  15. 计算机相关专业毕业生参加IT培训是否有必要?
  16. Sql 查询学生成绩表中每个科目的最高分及对应科目和学生
  17. Effective C++ 条款43
  18. PyQt5第一部分-窗口类:QWidget, QDeskWidget, QTabWidget, QMainWindow, QDialog
  19. 十分详细的jdk8时间相关操作以及知识点(文章很长)
  20. 红外控制Windows音量by python

热门文章

  1. 项目管理系统Cynthia
  2. 仿百度搜索框自动下拉提示
  3. a5 1c语言实现,A5算法的C语言实现
  4. python判断性别的源代码_python 通过手机号识别出对应的微信性别(实例代码)
  5. 超短激光与金属材料相互作用的Comsol双温模型(激光烧蚀)
  6. 大理石在哪儿(Uva10474)
  7. 30个顶级Python库 | 用于深度学习、自然语言处理和计算机视觉
  8. Archive of Our Own_为什么说for...of循环是JS中的宝石?
  9. 把英文翻译成中文php,中文翻译成英文,英文翻译成中文(调用的有道翻译的api)示例源码...
  10. 分享制作系统启动U盘的方法