oh my zsh的安装

curl安装

sh -c "$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"

设置固定主题

vim ~/.zshrc

# 找到 ZSH_THEME
# robbyrussell 是默认的主题
ZSH_THEME="robbyrussell" # ZSH_THEME="样式名称"

Powerlevel10k安装

git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Powerlevel10k 配置

vim ~/.zshrc

ZSH_THEME="powerlevel10k/powerlevel10k"

使得左侧显示用户名和主机

  1. 打开/home/username 中的.p10k.zsh文件找到其中的配置
  # The list of segments shown on the left. Fill it with the most important segments.

  typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
# os_icon # os identifier
dir # current directory
vcs # git status
# prompt_char # prompt symbol
)
  1. 向其中添加一个context
  # The list of segments shown on the left. Fill it with the most important segments.
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
context #user@hostname
# os_icon # os identifier
dir # current directory
vcs # git status
# prompt_char # prompt symbol
)
  1. 如果想只显示用户名而不显示主机名
  # Context format when running with privileges: user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m'
# Context format when in SSH without privileges: user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m'
# Default context format (no privileges, no SSH): user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m'

改为:

# Context format when running with privileges: user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n'
# Context format when in SSH without privileges: user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m'
# Default context format (no privileges, no SSH): user@hostname.
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n'

就可以在sshlocal的非root环境中不显示主机名

oh my zsh的安装的更多相关文章

  1. [转]Oh My Zsh,安装,主题配置

    https://swp-song.com/2017/08/20/Tools/OhMyZsh%E5%AE%89%E8%A3%85%E5%92%8C%E4%B8%BB%E9%A2%98%E9%85%8D% ...

  2. Mac下brew/memcached/nginx/iterm/zsh的安装

    brew  https://www.cnblogs.com/fireworld/p/8609190.html memcached https://blog.csdn.net/whereismatrix ...

  3. 2019.1.9 Mac安装Iterm2 终端(oh my zsh的安装与配置)

    Mac安装Iterm2 终端(oh my zsh的安装与配置) 安装 curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tool ...

  4. [转载]备忘:oh my zsh 的安装、更新、删除

    备忘:oh my zsh 的安装.更新.删除 傅易君 关注  0.8 2016.09.25 00:56* 字数 68 阅读 14920评论 0喜欢 4 查看系统当前 shell $ cat /etc/ ...

  5. Zsh和oh my zsh的安装和使用

    Zsh 兼容 Bash,据传说 99% 的 Bash 操作 和 Zsh 是相同的,默认 CentOS / Ubuntu / Mac 系统用的是 Bash,倒也不是说 Bash 不好,而是说我们有更好的 ...

  6. linux shell——zsh的安装与使用

    Shell是在程序员与服务器间建立一个桥梁,它对外提供一系列命令,让我们得以控制服务器.常用的Bash就是Shell的一种,也是Linux下默认Shell程序.这里介绍一种更强大的.更人性化的Shel ...

  7. Mac在zsh环境安装Maven

    Mac OS先安装了oh-my-zsh和iterm2,设置系统的默认语言为zsh.再安装Maven的时候,发现添加profile文件,关闭iterm后,mvn的环境变量一直没有生效. 折腾了好久,突然 ...

  8. macosx zsh下安装rvm和ruby

    1)curl -L get.rvm.io | bash -s stable 2)把下面一行加到~/.zshrc中: [[ -s "$HOME/.rvm/scripts/rvm" ] ...

  9. zsh的安装与配置

    参考: http://cnbin.github.io/blog/2015/06/01/mac-zsh-an-zhuang-he-shi-yong/ http://www.cnblogs.com/ios ...

  10. Ubuntu下安装配置zsh和oh my zsh

    zsh优势:自动补全功能强大和很高的可配置性 1.查看当前系统装了哪些shell    cat /etc/shells 2.当前正在运行的是哪个版本的shell    echo $SHELL 3.安装 ...

随机推荐

  1. FastAPI权限缓存:你的性能瓶颈是否藏在这只“看不见的手”里?

    title: FastAPI权限缓存:你的性能瓶颈是否藏在这只"看不见的手"里? date: 2025/06/23 05:27:13 updated: 2025/06/23 05: ...

  2. CAE科普!电池仿真的必要性

    在当前高油价与低排放的双重挑战下,新能源汽车以其动力电池驱动的特性成为了低碳环保.节能减排的必然选择.然而,电池系统性能的好坏直接关系到新能源电动汽车的行驶里程和使用便利性,其中充电时间.效率.能量密 ...

  3. ArkUI-X通过Stage模型开发Android端应用指南(二)

    StageApplication初始化支持以下三种方式 1. 通过继承StageApplication的方式进行初始化 import ohos.stage.ability.adapter.StageA ...

  4. nginx反向代理,负载均衡和yeauty集成的websocket的使用

    被要求一个这样的需求:要求项目和websocket使用一个端口.经过一周激烈争论,领导终于同意可以可以开通一个端口,一个月了,端口还没有开. 正式环境已经通过此方法进行部署,没有问题. 前言 因涉及到 ...

  5. 本地代理之Charles使用

    简介Charles是一款网络监测工具,还能将线上的资源代理(偷梁换柱)成本地的资源,再有时候不方便发版或修改源代码的时候,这一招倒是挺方便的 下载与安装官网地址:www.charlesproxy.co ...

  6. * .mesh 体网格文件解析

    简介 六面体网格由一个一个小方块构成 构建了一个小立方体的文件 cube.mesh MeshVersionFormatted 1 Dimension 3 Vertices 8 -1 -1 -1 1 1 ...

  7. Android List数组列表自定义排序

    自定义排序 例如:根据文件的最后修改时间进行排序,最新文件在前 Collections.sort(lstFiles, new Comparator<FileListData>() { @O ...

  8. Economic-Statistics-Investment-Analysis-: 美国上市公司的财务报表分析: 净利润率 + 市场销售增速 + 股东分红

    将经济政治和科学研究.微观和宏观.理论和实践 联合分析: 对每一类精深的统计研究分析 Systematical Method的研究透任何有兴趣的形成经验和个人能力 行业.组织.决策层.高管.个人 Qu ...

  9. Electrical(Hardware) Protocols: FIFO / Pmod™ / JTAG及常用插座(20pin,14pin,10pin)插头类型及针序/ SPI / IIC / IIS / UART / SWD / ICSP / CANBus/ModBus

    LVCMOS: Low Voltage COMS LVTTL: Low Voltage TTL Electrical(Hardware) Protocols: 0. Pmod: innovated b ...

  10. SciTech-Python-编译Python的C/C++扩展的setup.py使用pybind映射C/C++到Python库

    pybind:pybind11 - Seamless operability between C++11 and Python header-only library exposes C++ type ...