CentOS 终端 美化

安装 Tilix 终端

  • 添加 centos7Tilix
    # 创建 文件 /etc/yum.repos.d/ivoarch-Tilix-epel-7.repo
    # 写入以下内容
    [copr:copr.fedorainfracloud.org:ivoarch:Tilix]
    name=Copr repo for Tilix owned by ivoarch
    baseurl=https://copr-be.cloud.fedoraproject.org/results/ivoarch/Tilix/epel-7-$basearch/
    type=rpm-md
    skip_if_unavailable=True
    gpgcheck=1
    gpgkey=https://copr-be.cloud.fedoraproject.org/results/ivoarch/Tilix/pubkey.gpg
    repo_gpgcheck=0
    enabled=1
    enabled_metadata=1
  • 执行安装
    yum install -y tilix

安装 zsh

  • 执行安装
    yum install -y zsh
  • 设置默认shell
    chsh -s /bin/zsh
  • 安装oh-my-zsh
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

oh-my-zsh修改主题添加全路径显示

# 编辑 ~/.oh-my-zsh/themes/robbyrussell.zsh-theme

将 %c 替换为 [$PWD]
# 更多可用配置参考
%%  一个'%'
#%) 一个')'
%y  当前的tty名
%l  当前的tty名,如 pts/1
%M  完整主机名
%m  主机名(在第一个句号之前截断)
%n  当前用户名
%. %c %C 前两个显示相对路径的当前文件夹名,最后一个是绝对路径(也就是说,前两个在家目录下显示'~',最后那个显示你的用户名),'%'后的数字表示显示几层路径
%N  zsh 正在执行的脚本/函数名。如果'%'后跟了数字,似乎还有其他作用
%L  当前shell的层数
%j  当前正在进行的工作数量
%i  与%!类似:The line number currently being executed in the script, sourced file,<br>         or shell function given by %N. This is most useful for debugging as part of $PS4.
%!  显示当前历史事件号码(也就是打开shell后第几条命令)
%/ %d   显示当前工作路径($pwd)。如果'%'后面是一个整数,它指定显示路径的元件的数量;没有数字就显示整个路径。一个负整数就是指定主目录,即%-1d代表第一部分
%~  目前的工作目录相对于~的相对路径
%?  返回最后命令的执行结果的代码
%#  用户组,#(普通用户)/%(超级用户)
本作品采用《CC 协议》,转载必须注明作者和本文链接
这不是一个 BUG,这只是一个未列出来的特性!
itxq
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!