Git Bash 配置 zsh

embedded/2025/1/24 13:50:59/

博客食用更佳 博客链接

安装 zsh

安装 Zsh

|450

安装 Oh-my-zsh

github仓库

bash">sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
|550

git_bash__19">让 zsh 成为 git bash 默认终端

bash">vi ~/.bashrc

写入:

bashrc">if [ -t 1 ]; thenexec zsh
fi
bash">source ~/.bashrc

再重启即可。

更换主题

主题选择

安装主题 powerlevel10k

bash">git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

打开配置文件

bash">vi ~/.zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"

使得主题生效

bash">source ~/.zshrc

如果想重新配置 powerlevel10k 界面

bash">p10k configure

插件安装

高亮插件

zsh-syntax-highlighting

bash">git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

自动补全插件

zsh-autosuggestions

bash">git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

使插件生效

bash">vi ~/.zshrc

插件生效

bash">plugins=( git zsh-syntax-highlighting zsh-autosuggestions )
bash">source ~/.zshrc

使用 lsd 配色

官方仓库

|575

安装 lsd

可以使用 scoop 方式,其他方式见官方文档

bash">scoop install lsd

$HOME/.config/lsd 下创建配置文件 config. yml

|325
# == Classic ==
# This is a shorthand to override some of the options to be backwards compatible
# with `ls`. It affects the "color"->"when", "sorting"->"dir-grouping", "date"
# and "icons"->"when" options.
# Possible values: false, true
classic: false# == Blocks ==
# This specifies the columns and their order when using the long and the tree
# layout.
# Possible values: permission, user, group, context, size, date, name, inode, links, git
blocks:- permission- user- group- size- date- name# == Color ==
# This has various color options. (Will be expanded in the future.)
color:# When to colorize the output.# When "classic" is set, this is set to "never".# Possible values: never, auto, alwayswhen: auto# How to colorize the output.# When "classic" is set, this is set to "no-color".# Possible values: default, custom# When "custom" is set, lsd will look in the config directory for `colors.yaml`.theme: default# == Date ==
# This specifies the date format for the date column. The freeform format
# accepts a strftime like string.
# When "classic" is set, this is set to "date".
# Possible values: date, locale, relative, '+<date_format>'
# `date_format` will be a `strftime` formatted value. e.g. `date: '+%d %b %y %X'` will give you a date like this: 17 Jun 21 20:14:55
date: date# == Dereference ==
# Whether to dereference symbolic links.
# Possible values: false, true
dereference: false# == Display ==
# What items to display. Do not specify this for the default behavior.
# Possible values: all, almost-all, directory-only
# display: all# == Icons ==
icons:# When to use icons.# When "classic" is set, this is set to "never".# Possible values: always, auto, neverwhen: auto# Which icon theme to use.# Possible values: fancy, unicodetheme: fancy# Separator between icon and the name# Default to 1 spaceseparator: " "# == Ignore Globs ==
# A list of globs to ignore when listing.
# ignore-globs:
#   - .git# == Indicators ==
# Whether to add indicator characters to certain listed files.
# Possible values: false, true
indicators: false# == Layout ==
# Which layout to use. "oneline" might be a bit confusing here and should be
# called "one-per-line". It might be changed in the future.
# Possible values: grid, tree, oneline
layout: grid# == Recursion ==
recursion:# Whether to enable recursion.# Possible values: false, trueenabled: false# How deep the recursion should go. This has to be a positive integer. Leave# it unspecified for (virtually) infinite.# depth: 3# == Size ==
# Specifies the format of the size column.
# Possible values: default, short, bytes
size: default# == Permission ==
# Specify the format of the permission column
# Possible value: rwx, octal, attributes (windows only), disable
permission: rwx# == Sorting ==
sorting:# Specify what to sort by.# Possible values: extension, name, time, size, versioncolumn: name# Whether to reverse the sorting.# Possible values: false, truereverse: false# Whether to group directories together and where.# When "classic" is set, this is set to "none".# Possible values: first, last, nonedir-grouping: none# == No Symlink ==
# Whether to omit showing symlink targets
# Possible values: false, true
no-symlink: false# == Total size ==
# Whether to display the total size of directories.
# Possible values: false, true
total-size: false# == Hyperlink ==
# Attach hyperlink to filenames
# Possible values: always, auto, never
hyperlink: never# == Symlink arrow ==
# Specifies how the symlink arrow display, chars in both ascii and utf8
symlink-arrow:# == Header ==
# Whether to display block headers.
# Possible values: false, true
header: true# == Literal ==
# Whether to show quotes on filenames.
# Possible values: false, true
literal: false# == Truncate owner ==
# How to truncate the username and group names for a file if they exceed a certain
# number of characters.
truncate-owner:# Number of characters to keep. By default, no truncation is done (empty value).after:# String to be appended to a name if truncated.marker: ""

要注意 permission,改成其他的可能会导致用户名和组别显示 ?

bash">vi ~/.zshrc

添加别名

alias ls='lsd'
alias l='ls -l'
alias la='ls -a'
alias lla='ls -la'
alias lt='ls --tree'

http://www.ppmy.cn/embedded/156584.html

相关文章

【LeetCode】--- MySQL刷题集合

1.组合两个表&#xff08;外连接&#xff09; select p.firstName,p.lastName,a.city,a.state from Person p left join Address a on p.personId a.personId; 以左边表为基准&#xff0c;去连接右边的表。取两表的交集和左表的全集 2.第二高的薪水 &#xff08;子查询、if…

防火墙安全策略

目录 一.拓扑信息 二.需求分析 三.命令行详细配置信息 1.配置IP 2.交换机配置 3.修改安全区域 4.安全策略 四.web界面详细配置 1.配置IP和设置安全区域 2.交换机配置 3.安全策略 五.测试 一.拓扑信息 二.需求分析 1.VLAN 2属于办公区域&#xff1b;VLAN 3属于生…

webrtc入门系列(五)amazon-kinesis-video-streams-webrtc-sdk-c编译

《webrtc入门系列&#xff08;一&#xff09;easy_webrtc_server 入门环境搭建》 《webrtc入门系列&#xff08;二&#xff09;easy_webrtc_server 入门example测试》 《webrtc入门系列&#xff08;三&#xff09;云服务器coturn环境搭建》 《webrtc入门系列&#xff08;四&…

FastExcel 新一代的潮流 (EasyExcel)

目录 简介 FastExcel的特点 FastExcel使用方法详解 创建实体类和监听器 实现写入和读取功能 Excel转换为PDF 小结 FastExcel与EasyExcel的区别 结论 简介 FastExcel是由原EasyExcel作者在阿里巴巴宣布停止维护EasyExcel之后推出的升级版框架。它继承了EasyExcel的所有…

python milvus及curl命令进行query请求

代码如下: from pymilvus import MilvusClient client = MilvusClient( uri="http://localhost:19530", token="root:Milvus" ) res = client.query( collection_name="query_collection", filter="color like \"…

“““【运用 R 语言里的“predict”函数针对 Cox 模型展开新数据的预测以及推理。】“““

主题与背景 本文主要介绍了如何在R语言中使用predict函数对已拟合的Cox比例风险模型进行新数据的预测和推理。Cox模型是一种常用的生存分析方法&#xff0c;用于评估多个因素对事件发生时间的影响。文章通过具体的代码示例展示了如何使用predict函数的不同参数来获取生存概率和…

【统计的思想】假设检验(二)

假设检验是根据人为设定的显著水平&#xff0c;对被测对象的总体质量特性进行统计推断的方法。 如果我们通过假设检验否定了零假设&#xff0c;只是说明在设定的显著水平下&#xff0c;零假设成立的概率比较小&#xff0c;并不是说零假设就肯定不成立。如果零假设事实上是成立…

如何轻松实现域名指向服务器

在互联网时代&#xff0c;域名指向服务器是网站上线的关键步骤。域名是用户访问网站的入口&#xff0c;而服务器则是存储网站数据的地方。将域名正确指向服务器&#xff0c;能让用户顺利访问网站内容。虽然这个过程对新手来说可能有些陌生&#xff0c;但只要掌握正确的方法&…