oh my zsh和starship工具安装笔记

1.oh my zsh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 1.安装zsh
>> sudo apt install zsh
# 2.安装oh-my-zsh
## (1) 能访问github
>> sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
## (2) 不能访问github
>> git clone https://gitee.com/mirrors/oh-my-zsh.git ~/.oh-my-zsh
>> cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
## (3) 刷新配置
>> zsh
# 3.配置插件
>> vim ~/.zshrc
plugins=(git z zsh-autosuggestions extract web-search zsh-syntax-highlighting colored-man-pages history)
# 4.安装插件
# (1) 能访问github
>> git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
>> git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
# (2) 不能访问github
>> git clone https://gitee.com/sasukeZhou/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
>> git clone https://gitee.com/pankla/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
## (3) 刷新配置
>> source ~/.zshrc

2.starship

2.1 安装

1
2
3
4
5
6
7
8
# 1.安装starship
>> curl -sS https://starship.rs/install.sh | sh
# 2.设置shell使用
>> vim ~/.zshrc
## 最后添加如下内容
eval "$(starship init zsh)"
# 3.刷新环境变量
>> source ~/.zshrc

2.2 配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 1.创建配置文件
>> mkdir -p ~/.config && vim ~/.config/starship.toml
# 2.添加如下内容
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'

# Inserts a blank line between shell prompts
add_newline = true

# Replace the '❯' symbol in the prompt with '➜'
[character] # The name of the module we are configuring is 'character'
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'

# Disable the package module, hiding it from the prompt completely
[package]
disabled = true
[cmake]
disabled = true

参考资料